summaryrefslogtreecommitdiff
path: root/roles/postfix/simple/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/postfix/simple/tasks/main.yml')
-rw-r--r--roles/postfix/simple/tasks/main.yml22
1 files changed, 22 insertions, 0 deletions
diff --git a/roles/postfix/simple/tasks/main.yml b/roles/postfix/simple/tasks/main.yml
new file mode 100644
index 00000000..4309c3ac
--- /dev/null
+++ b/roles/postfix/simple/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+- name: install postfix package
+ apt:
+ name: postfix
+ state: present
+
+- name: basic postfix options
+ vars:
+ postfix_options:
+ mydestination: "{{ postfix_simple_mydestination | join(', ') }}"
+ mynetworks: "{{ postfix_simple_mynetworks | join(', ') }}"
+ relayhost: "{{ postfix_simple_relayhost }}"
+ inet_interfaces: "{{ postfix_simple_inet_interfaces | join(', ') }}"
+ inet_protocols: "{{ postfix_simple_inet_protocols | join(', ') }}"
+ loop: "{{ postfix_options | dict2items }}"
+ loop_control:
+ label: "{{ item.key }} = {{ item.value }}"
+ lineinfile:
+ regexp: "^#?\\s*{{ item.key }}\\s*="
+ line: "{{ item.key }} = {{ item.value }}"
+ dest: /etc/postfix/main.cf
+ notify: restart postfix