summaryrefslogtreecommitdiffstats
path: root/roles/lists/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lists/tasks')
-rw-r--r--roles/lists/tasks/mail.yml35
-rw-r--r--roles/lists/tasks/main.yml2
-rw-r--r--roles/lists/tasks/mlmmj.yml78
3 files changed, 115 insertions, 0 deletions
diff --git a/roles/lists/tasks/mail.yml b/roles/lists/tasks/mail.yml
new file mode 100644
index 0000000..7bd471e
--- /dev/null
+++ b/roles/lists/tasks/mail.yml
@@ -0,0 +1,35 @@
+- name: Install Postfix
+ apt: pkg={{ item }}
+ with_items:
+ - postfix
+ - postfix-ldap
+
+- name: Configure Postfix
+ template: src=etc/postfix/main.cf.j2
+ dest=/etc/postfix-{{ postfix_instance[inst].name }}/main.cf
+ owner=root group=root
+ mode=0644
+ register: r
+ notify:
+ - Restart Postfix
+
+- name: Create directory /etc/postfix-.../virtual
+ file: path=/etc/postfix-{{ postfix_instance[inst].name }}/virtual
+ state=directory
+ owner=root group=root
+ mode=0755
+
+- name: Copy lookup tables
+ copy: src=etc/postfix/virtual/{{ item }}
+ dest=/etc/postfix-{{ postfix_instance[inst].name }}/virtual/{{ item }}
+ owner=root group=root
+ mode=0644
+ with_items:
+ - mailbox_domains.cf
+ - transport_lists_maps.cf
+
+- name: Start Postfix
+ service: name=postfix state=started
+ when: not r.changed
+
+- meta: flush_handlers
diff --git a/roles/lists/tasks/main.yml b/roles/lists/tasks/main.yml
new file mode 100644
index 0000000..13d3451
--- /dev/null
+++ b/roles/lists/tasks/main.yml
@@ -0,0 +1,2 @@
+- include: mail.yml tags=postfix,mail
+- include: mlmmj.yml tags=mlmmj,lists
diff --git a/roles/lists/tasks/mlmmj.yml b/roles/lists/tasks/mlmmj.yml
new file mode 100644
index 0000000..0b88d75
--- /dev/null
+++ b/roles/lists/tasks/mlmmj.yml
@@ -0,0 +1,78 @@
+- name: Install MLMMJ
+ apt: pkg={{ item }}
+ with_items:
+ - mlmmj
+
+# Weird the debian package doesn't do it by itself...
+- name: Create a user 'mlmmj'
+ user: name=mlmmj system=yes
+ home=/var/spool/mlmmj
+ shell=/bin/false
+ password=!
+ state=present
+
+- name: Add 'www-data' to the group 'mlmmj'
+ user: name=www-data groups=mlmmj append=yes
+
+- name: Create a home directory for user 'mlmmj'
+ file: path=/var/spool/mlmmj
+ state=directory
+ owner=mlmmj group=mlmmj
+ mode=0700
+
+- name: Create /var/lib/mlmmj
+ file: path=/var/lib/mlmmj
+ state=directory
+ owner=mlmmj group=mlmmj
+ mode=0750
+
+- name: Auto-maintain mlmmj's spool directory
+ copy: src=etc/cron.d/mlmmj
+ dest=/etc/cron.d/mlmmj
+ owner=root group=root
+ mode=0644
+
+- name: Copy mlmmj-newlist.sh and mhonarc-scan.sh
+ copy: src=usr/local/bin/{{ item }}
+ dest=/usr/local/bin/{{ item }}
+ owner=root group=root
+ mode=0755
+ with_items:
+ - mlmmj-newlist.sh
+ - mhonarc-scan.sh
+
+- name: Copy /etc/mhonarc.rc
+ copy: src=etc/mhonarc.rc
+ dest=/etc/mhonarc.rc
+ owner=root group=root
+ mode=0644
+
+- name: Create /var/lib/mlmmj/...
+ file: path=/var/lib/mlmmj/{{ item }}
+ state=directory
+ owner=root group=root
+ mode=0755
+ with_items:
+ - static
+ - static/css
+ - static/fonts
+
+- name: Copy CSS files
+ copy: src=var/lib/mlmmj/static/css/{{ item }}
+ dest=/var/lib/mlmmj/static/css/{{ item }}
+ owner=root group=root
+ mode=0644
+ with_items:
+ - bootstrap.min.css
+ - fripost.css
+
+- name: Copy Glyphicon Halflings
+ copy: src=var/lib/mlmmj/static/fonts/{{ item }}
+ dest=/var/lib/mlmmj/static/fonts/{{ item }}
+ owner=root group=root
+ mode=0644
+ with_items:
+ - glyphicons-halflings-regular.eot
+ - glyphicons-halflings-regular.svg
+ - glyphicons-halflings-regular.ttf
+ - glyphicons-halflings-regular.woff