aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/postfix-satellite/tasks/postfix-satellite.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/ansible/roles/postfix-satellite/tasks/postfix-satellite.yml b/ansible/roles/postfix-satellite/tasks/postfix-satellite.yml
index 8a11a84..2303523 100644
--- a/ansible/roles/postfix-satellite/tasks/postfix-satellite.yml
+++ b/ansible/roles/postfix-satellite/tasks/postfix-satellite.yml
@@ -2,6 +2,7 @@
package:
name: "{{ items }}"
state: present
+ tags: packages
vars:
items:
- postfix
@@ -13,15 +14,20 @@
notify: reload postfix
lineinfile:
dest: /etc/postfix/main.cf
- line: "{{ item.key }} = {{ item.value }}"
+ line: "{{ (item.key + ' = ' + item.value) if state=='present' else None }}"
regexp: "^{{ item.key }} ="
+ state: "{{ state }}"
+ vars:
+ state: "{{ item.state|default('present') }}"
with_items:
- key: "mydomain"
value: "{{ postfix_satellite__mydomain }}"
- key: "myorigin"
value: "{{ postfix_satellite__myorigin }}"
- key: "mydestination"
- value: ""
+ state: absent
+ - key: "myhostname"
+ state: absent
- key: "mynetworks"
value: "{{ postfix_satellite__mynetworks }}"
- key: "smtp_sasl_auth_enable"
@@ -38,6 +44,10 @@
value: "4096000"
- key: "relayhost"
value: "{{ postfix__relayhost }}"
+ - key: "default_transport"
+ state: absent
+ - key: "relay_transport"
+ state: absent
- name: Create /etc/postfix/sasl_passwd
tags: postfix-satellite-config