From 68515bbb478f326a252ca688fcc97f3fdc8c4f97 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Sun, 28 Aug 2016 16:08:42 +0200 Subject: Initial commit, finally got around to cleanup and make it into a gitrepo. --- roles/postfix/tasks/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 roles/postfix/tasks/main.yml (limited to 'roles/postfix/tasks') diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml new file mode 100644 index 0000000..8c51a91 --- /dev/null +++ b/roles/postfix/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- name: Install postfix + become: yes + pacman: name=postfix state=present update_cache=yes + +- name: copy master.cf + become: yes + copy: src=master.cf dest=/etc/postfix/master.cf + +- name: copy main.cf, mysql-virtual-alias-maps.cf mysql-virtual-mailbox-domains.cf and mysql-virtual-mailbox-maps.cf + become: yes + template: src={{ item.input }} dest=/etc/postfix/{{ item.output }} mode={{ item.mode }} + with_items: + - { input: main.cf.j2, output: main.cf, mode: 644 } + - { input: mysql-virtual-alias-maps.cf.j2, output: mysql-virtual-alias-maps.cf, mode: 640 } + - { input: mysql-virtual-mailbox-domains.cf.j2, output: mysql-virtual-mailbox-domains.cf, mode: 640 } + - { input: mysql-virtual-mailbox-maps.cf.j2, output: mysql-virtual-mailbox-maps.cf, mode: 640 } + +- name: copy aliases + become: yes + copy: remote_src=yes src=/etc/postfix/aliases dest=/etc/aliases + +- name: create aliases.db + become: yes + command: newaliases + args: + creates: /etc/aliases.dbr + +- name: start and enable postfix + become: yes + service: name=postfix state=started enabled=yes -- cgit v1.2.3-70-g09d2