summaryrefslogtreecommitdiffstats
path: root/roles/mailman/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/mailman/tasks')
-rw-r--r--roles/mailman/tasks/main.yml36
1 files changed, 36 insertions, 0 deletions
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