-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathplaybook-list-servers.yaml
72 lines (70 loc) · 2.46 KB
/
playbook-list-servers.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
- name: List Servers
hosts: list_servers
roles:
- role: galaxyproject.general.virtual
# postfix here to get the elastic IP
tags: [general, postfix]
- role: galaxyproject.general.packages
tags: [general, mailman]
- role: galaxyproject.general.paths
tags: [general, mailman]
- role: galaxyproject.general.users
tags: [general, mailman, users]
- role: galaxyproject.opendkim
tags: [postfix, opendkim]
- role: galaxyproject.postfix
tags: postfix
- role: galaxyproject.postgresql
tags: postgres
- role: usegalaxy_org.postgresql_relocate_pgdata
tags: postgres
- role: galaxyproject.postgresql_objects
become: true
become_user: postgres
tags: postgres
- role: galaxyproject.mailman3
tags: mailman
- role: galaxyproject.nginx
tags: nginx
post_tasks:
- name: Add postfix user to opendkim group
user:
name: postfix
groups: opendkim
notify:
- restart postfix
tags: postfix
- name: Deploy Mailman venv extra files (files)
ansible.builtin.copy:
src: "mailman/{{ item.name }}"
dest: "{{ (mailman3_install_dir, item.dir, item.name) | path_join }}"
mode: "{{ '0755' if item.dir == 'bin' else '0644' }}"
loop: "{{ mailman3_venv_extra_files }}"
when: not item.name.endswith('.j2')
- name: Deploy Mailman venv extra files (templates)
ansible.builtin.template:
src: "mailman/{{ item.name }}"
dest: "{{ (mailman3_install_dir, item.dir, item.name | splitext | first) | path_join }}"
mode: "{{ '0755' if item.dir == 'bin' else '0644' }}"
loop: "{{ mailman3_venv_extra_files }}"
when: item.name.endswith('.j2')
- name: Source virtualenv in Mailman users .bashrc
ansible.builtin.lineinfile:
path: "{{ item }}"
line: "[[ -n $VIRTUAL_ENV ]] || . {{ mailman3_install_dir }}/bin/activate"
loop:
- /var/list/.bashrc
- /var/lib/mailman3/web/.bashrc
- name: Add aliases for mailman-web in mailman3-web user .bashrc
ansible.builtin.lineinfile:
path: /var/lib/mailman3/web/.bashrc
line: "alias mailman-web-{{ item }}='PYTHONPATH=/var/lib/mailman3/web/project DJANGO_SETTINGS_MODULE=settings_lists_{{ item }}project_org mailman-web'"
loop:
- galaxy
- anvil
- name: MX Servers
hosts: mx_servers
roles:
- role: galaxyproject.general.users
tags: [general, mailman]