From ca315bf9c292d4757b67a86117e3182c1b0dd680 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 12 Dec 2014 14:28:47 +0100 Subject: Import postfix/mailman from rad --- roles/mailman/tasks/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 roles/mailman/tasks/main.yml (limited to 'roles/mailman/tasks') diff --git a/roles/mailman/tasks/main.yml b/roles/mailman/tasks/main.yml new file mode 100644 index 0000000..e5b78da --- /dev/null +++ b/roles/mailman/tasks/main.yml @@ -0,0 +1,36 @@ +--- +- yum: name={{ item }} state=installed + with_items: + - mailman + - git + - pwgen + +- command: creates=/var/lib/mailman/lists/mailman /usr/lib/mailman/bin/newlist -q mailman root@{{ ansible_domain }} {{ mailman_pass }} + +# +# this is a ugly work around for https://github.com/ansible/ansible-modules-core/issues/127 +- file: name=/etc/systemd/system/mailman.service.d/ state=directory + when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7' + +- copy: mode=0644 src=fix_ansible.conf dest=/etc/systemd/system/mailman.service.d/fix_ansible_bug.conf + when: ansible_distribution == 'Fedora' or ansible_distribution_major_version == '7' + +- template: src=mm_cfg.py dest=/etc/mailman/mm_cfg.py + +- service: name=mailman state=started enabled=yes + +- template: src=aliases dest=/etc/postfix/aliases.mailman_default + notify: update mailman aliases + + +- template: src=vhost.conf dest=/etc/httpd/conf.d/{{ website_url | default( ansible_hostname ) }}.conf + notify: restart httpd + +- copy: mode=0755 src=update_templates_mailman.sh dest=/usr/local/bin/update_templates_mailman.sh + +- cron: name="update mailman {{ mailman_git }}" job="/usr/local/bin/update_templates_mailman.sh {{ mailman_git }}" minute="*/5" + when: mailman_git is defined + +- copy: mode=0755 src=dump_mailman.sh dest=/usr/local/bin/dump_mailman.sh + +- cron: name="dump mailman" job=/usr/local/bin/dump_mailman.sh hour=3 minute=30 -- cgit