309ae73b8a
We are using synchronize to copy the openstack mailman templates which preserved the ownership and group and permissions of the source files on bridge. This isn't a major problem but it is ugly so we fix it. To fix it we set rsync_opts for synchronize to set a usermap and a groupmap to map the bridge info to the data we want on the remote. Change-Id: I209345cbe9e27beb18d1ba31e6715bf850bc022b
112 lines
3.0 KiB
YAML
112 lines
3.0 KiB
YAML
- name: Set mailman site root fact
|
|
set_fact:
|
|
mm_site_root: "/srv/mailman/{{ mailman_site.name }}"
|
|
cacheable: no
|
|
|
|
- name: Create mm site dirs
|
|
file:
|
|
path: "{{ inner_site_dir }}"
|
|
state: directory
|
|
owner: list
|
|
group: list
|
|
mode: '2775'
|
|
loop:
|
|
- "{{ mm_site_root }}/"
|
|
- "{{ mm_site_root }}/etc"
|
|
- "{{ mm_site_root }}/lists"
|
|
- "{{ mm_site_root }}/logs"
|
|
- "{{ mm_site_root }}/locks"
|
|
- "{{ mm_site_root }}/data"
|
|
- "{{ mm_site_root }}/spam"
|
|
- "{{ mm_site_root }}/mail"
|
|
- "{{ mm_site_root }}/run"
|
|
- "{{ mm_site_root }}/archives"
|
|
- "{{ mm_site_root }}/archives/public"
|
|
- "{{ mm_site_root }}/archives/private"
|
|
- "{{ mm_site_root }}/templates"
|
|
- "{{ mm_site_root }}/qfiles"
|
|
- "{{ mm_site_root }}/qfiles/in"
|
|
- "{{ mm_site_root }}/qfiles/out"
|
|
- "{{ mm_site_root }}/qfiles/commands"
|
|
- "{{ mm_site_root }}/qfiles/bounces"
|
|
- "{{ mm_site_root }}/qfiles/news"
|
|
- "{{ mm_site_root }}/qfiles/archive"
|
|
- "{{ mm_site_root }}/qfiles/shunt"
|
|
- "{{ mm_site_root }}/qfiles/virgin"
|
|
- "{{ mm_site_root }}/qfiles/bad"
|
|
- "{{ mm_site_root }}/qfiles/retry"
|
|
- "{{ mm_site_root }}/qfiles/maildir"
|
|
loop_control:
|
|
loop_var: inner_site_dir
|
|
|
|
- name: Link html templates into site
|
|
file:
|
|
state: link
|
|
src: "/usr/share/mailman/{{ site_language }}"
|
|
dest: "{{ mm_site_root }}/templates/{{ site_language }}"
|
|
owner: root
|
|
group: root
|
|
loop: "{{ mailman_site.install_languages }}"
|
|
loop_control:
|
|
loop_var: site_language
|
|
|
|
- name: Create openstack specific en templates dir
|
|
file:
|
|
state: directory
|
|
path: /srv/mailman/openstack/templates/en
|
|
owner: root
|
|
group: list
|
|
mode: '0755'
|
|
when: mailman_site.name == "openstack"
|
|
- name: Copy openstack specific en templates into site
|
|
synchronize:
|
|
src: openstack/html-templates-en/
|
|
dest: /srv/mailman/openstack/templates/en
|
|
rsync_opts:
|
|
- "--usermap=*:root"
|
|
- "--groupmap=*:list"
|
|
when: mailman_site.name == "openstack"
|
|
|
|
- name: Create site specific config
|
|
template:
|
|
src: mm_site_cfg.py.j2
|
|
dest: "{{ mm_site_root }}/etc/mm_cfg_local.py"
|
|
owner: root
|
|
group: root
|
|
mode: '0444'
|
|
|
|
- name: Create normal mailman vhost config
|
|
template:
|
|
src: mailman_multihost.vhost.j2
|
|
dest: "/etc/apache2/sites-enabled/50-{{ mailman_site.listdomain }}.conf"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: mailman site reload apache2
|
|
|
|
- name: Create site init script
|
|
template:
|
|
src: mailman.init.j2
|
|
dest: "/etc/init.d/mailman-{{ mailman_site.name }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0755'
|
|
|
|
- name: Enable mailman site service
|
|
service:
|
|
name: "mailman-{{ mailman_site.name }}"
|
|
enabled: yes
|
|
|
|
- name: Create mailman site lists
|
|
include_role:
|
|
name: mailman-list
|
|
vars:
|
|
mm_site_name: "{{ mailman_site.name }}"
|
|
mm_list_name: "{{ site_list.name }}"
|
|
mm_list_description: "{{ site_list.description }}"
|
|
mm_list_admin: "{{ site_list.admin }}"
|
|
mm_list_password: "{{ site_list.password }}"
|
|
loop: "{{ mailman_site.lists }}"
|
|
loop_control:
|
|
loop_var: site_list
|