Refactored to individual files by function

This commit is contained in:
2016-11-17 13:41:44 +13:00
parent a1ac1de7e2
commit 2111038879
4 changed files with 142 additions and 149 deletions

34
tasks/communication.yml Normal file
View File

@@ -0,0 +1,34 @@
---
- name: Apply postfix configuration
lineinfile:
dest: "{{item.dest}}"
regexp: "{{item.regexp}}"
line: "{{item.line}}"
insertafter: EOF
notify: Restart Postfix
with_items:
- { dest: /etc/postfix/main.cf,
regexp: "inet_protocols =",
line: "inet_protocols = ipv4"
}
- { dest: /etc/postfix/main.cf,
regexp: "inet_interfaces =",
line: "inet_interfaces = all"
}
- { dest: /etc/postfix/main.cf,
regexp: "relayhost =",
line: "relayhost = {{ relayhost }}"
}
- name: Ensure Postfix is Started/Enabled
service:
name: postfix
state: started
enabled: yes
- name: Ensure root forwarding address is set
lineinfile:
dest: ~/.forward
regexp: "{{ root_email }}"
line: "{{ root_email }}"
create: yes