]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/postfix/tasks/main.yml
postfix: Configure a satellite system and use debconf
[AnsibleRoles.git] / roles / postfix / tasks / main.yml
1 ---
2 # postfix tasks
3
4 - name: 'debconf(1): configure Postfix as "Satellite system"'
5   tags:
6     - debconf
7     - mail
8     - postfix
9   debconf: >
10     name=postfix
11     question=postfix/main_mailer_type
12     value="Satellite system"
13     vtype=select
14
15 - name: 'debconf(1): set system mail name'
16   tags:
17     - debconf
18     - mail
19     - postfix
20   debconf: >
21     name=postfix
22     question=postfix/mailname
23     value="{{ postfix_mailname }}"
24     vtype=string
25
26 - name: 'debconf(1): set SMTP relay host'
27   tags:
28     - debconf
29     - mail
30     - postfix
31   debconf: >
32     name=postfix
33     question=postfix/relayhost
34     value="{{ smtp_relay_host }}"
35     vtype=string
36
37 - name: 'debconf(1): set root and postmaster recipient'
38   tags:
39     - debconf
40     - mail
41     - postfix
42   debconf: >
43     name=postfix
44     question=postfix/root_address
45     value="{{ postfix_root_address }}"
46     vtype=string
47
48 - name: 'debconf(1): set other destinations to accept mail for'
49   tags:
50     - debconf
51     - mail
52     - postfix
53   debconf: >
54     name=postfix
55     question=postfix/destinations
56     value="{{ postfix_destinations }}"
57     vtype=string
58
59 - name: 'debconf(1): set local networks'
60   tags:
61     - debconf
62     - mail
63     - postfix
64   debconf: >
65     name=postfix
66     question=postfix/mynetworks
67     value="{{ postfix_local_networks }}"
68     vtype=string
69
70 - name: 'debconf(1): set mailbox size limit'
71   tags:
72     - debconf
73     - mail
74     - postfix
75   debconf: >
76     name=postfix
77     question=postfix/mailbox_limit
78     value="{{ postfix_mailbox_limit }}"
79     vtype=string
80
81 - name: 'debconf(1): set local address extension character'
82   tags:
83     - debconf
84     - mail
85     - postfix
86   debconf: >
87     name=postfix
88     question=postfix/recipient_delim
89     value="{{ postfix_recipient_delim }}"
90     vtype=string
91
92 - name: 'debconf(1): set internet protocols to use'
93   tags:
94     - debconf
95     - mail
96     - postfix
97   debconf: >
98     name=postfix
99     question=postfix/protocols
100     value="{{ postfix_protocols }}"
101     vtype=string
102
103 - name: 'debconf(1): configure synchronous updates on mail queue'
104   tags:
105     - debconf
106     - mail
107     - postfix
108   debconf: >
109     name=postfix
110     question=postfix/chattr
111     value="{{ postfix_sync_updates }}"
112     vtype=boolean
113
114 - name: install "postfix" package
115   tags:
116     - mail
117     - packages
118     - postfix
119   apt: >
120     state=installed
121     name=postfix
122
123 - name: setup "/etc/mailname"
124   tags:
125     - mail
126     - postfix
127   template: >
128     dest=/etc/mailname
129     group=root
130     mode=0644
131     owner=root
132     src=mailname.j2
133   notify:
134     - restart "postfix"
135
136 - name: set Posfix "myorigin"
137   tags:
138     - mail
139     - postfix
140   lineinfile: >
141     dest=/etc/postfix/main.cf
142     group=root
143     line="myorigin = /etc/mailname"
144     mode=0644
145     owner=root
146     regexp="^myorigin"
147   notify:
148     - restart "postfix"
149
150 - name: set Posfix "inet_interfaces"
151   tags:
152     - mail
153     - postfix
154   lineinfile: >
155     dest=/etc/postfix/main.cf
156     line="inet_interfaces = {{ postfix_interfaces }}"
157     regexp="^inet_interfaces"
158   notify:
159     - restart "postfix"
160
161 - name: ensure service "postfix" is enabled and started
162   tags:
163     - mail
164     - postfix
165     - services
166   service: >
167     enabled=yes
168     name=postfix
169     state=started