summaryrefslogtreecommitdiffstats
path: root/roles/mailman_lists
diff options
context:
space:
mode:
Diffstat (limited to 'roles/mailman_lists')
-rw-r--r--roles/mailman_lists/meta/main.yml4
-rw-r--r--roles/mailman_lists/tasks/main.yml6
-rw-r--r--roles/mailman_lists/templates/aliases13
3 files changed, 23 insertions, 0 deletions
diff --git a/roles/mailman_lists/meta/main.yml b/roles/mailman_lists/meta/main.yml
new file mode 100644
index 0000000..6eb9cb8
--- /dev/null
+++ b/roles/mailman_lists/meta/main.yml
@@ -0,0 +1,4 @@
+---
+dependencies:
+- { role: mailman }
+
diff --git a/roles/mailman_lists/tasks/main.yml b/roles/mailman_lists/tasks/main.yml
new file mode 100644
index 0000000..c9c1634
--- /dev/null
+++ b/roles/mailman_lists/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- command: creates=/var/lib/mailman/lists/{{ item.name }} /usr/lib/mailman/bin/newlist {{ item.name }}@{{ mailman_prefix }} {{ item.owner | default( mailman_default_owner ) }} $(pwgen -1 14)
+ with_items: mailman_lists
+
+- template: src=aliases dest=/etc/postfix/aliases.mailman
+ notify: update mailman aliases
diff --git a/roles/mailman_lists/templates/aliases b/roles/mailman_lists/templates/aliases
new file mode 100644
index 0000000..7d83dd3
--- /dev/null
+++ b/roles/mailman_lists/templates/aliases
@@ -0,0 +1,13 @@
+{% for item in mailman_lists %}
+##
+{{ item.name }}: "|/usr/lib/mailman/mail/mailman post {{ item.name }}"
+{{ item.name }}-admin: "|/usr/lib/mailman/mail/mailman admin {{ item.name }}"
+{{ item.name }}-bounces: "|/usr/lib/mailman/mail/mailman bounces {{ item.name }}"
+{{ item.name }}-confirm: "|/usr/lib/mailman/mail/mailman confirm {{ item.name }}"
+{{ item.name }}-join: "|/usr/lib/mailman/mail/mailman join {{ item.name }}"
+{{ item.name }}-leave: "|/usr/lib/mailman/mail/mailman leave {{ item.name }}"
+{{ item.name }}-owner: "|/usr/lib/mailman/mail/mailman owner {{ item.name }}"
+{{ item.name }}-request: "|/usr/lib/mailman/mail/mailman request {{ item.name }}"
+{{ item.name }}-subscribe: "|/usr/lib/mailman/mail/mailman subscribe {{ item.name }}"
+{{ item.name }}-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe {{ item.name }}"
+{% endfor %}