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