Updated regex for postfix configurations

This commit is contained in:
2019-01-22 09:06:04 +13:00
parent df37b699d3
commit 538a5a0142

View File

@@ -11,20 +11,20 @@
when: "'SMTP0' not in inventory_hostname" when: "'SMTP0' not in inventory_hostname"
with_items: with_items:
- { dest: /etc/postfix/main.cf, - { dest: /etc/postfix/main.cf,
regexp: "inet_protocols =", regexp: "^.?inet_protocols =",
line: "inet_protocols = ipv4" line: "inet_protocols = ipv4"
} }
- { dest: /etc/postfix/main.cf, - { dest: /etc/postfix/main.cf,
regexp: "inet_interfaces =", regexp: "^.?inet_interfaces =",
line: "inet_interfaces = all" line: "inet_interfaces = all"
} }
- { dest: /etc/postfix/main.cf, - { dest: /etc/postfix/main.cf,
regexp: "relayhost =", regexp: "^.?relayhost =",
line: "relayhost = {{ relayhost }}" line: "relayhost = {{ relayhost }}"
} }
- { - {
dest: /etc/postfix/main.cf, dest: /etc/postfix/main.cf,
regexp: "smtp_randomize_addresses =", regexp: "^.?smtp_randomize_addresses =",
line: "smtp_randomize_addresses = no" line: "smtp_randomize_addresses = no"
} }
@@ -40,4 +40,4 @@
dest: ~/.forward dest: ~/.forward
regexp: "{{ root_email }}" regexp: "{{ root_email }}"
line: "{{ root_email }}" line: "{{ root_email }}"
create: yes create: yes