Skip to content

Commit 15f9d26

Browse files
committed
Ansible custom tasks
1 parent eaa9c9d commit 15f9d26

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

ansible/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
## Ansible customizations
3+
4+
When deploying the ansible role https://github.com/cppalliance/ansible-mailman3, copy the custom/ folder here to the ansible tasks/ folder, so the resulting directory structure is tasks/custom/main.yml.
5+

ansible/custom/main.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
3+
# Boost customizations
4+
#
5+
6+
- name: Create directory for git repo
7+
ansible.builtin.file:
8+
path: "/opt/github/ansible-managed/"
9+
state: directory
10+
owner: "root"
11+
group: "root"
12+
mode: "0755"
13+
14+
- name: Checkout boost-mailman
15+
ansible.builtin.git:
16+
repo: 'https://github.com/cppalliance/boost-mailman.git'
17+
dest: /opt/github/ansible-managed/boost-mailman
18+
version: custom-files
19+
20+
- name: Copy boost static files
21+
ansible.builtin.copy:
22+
src: "{{ item.src }}"
23+
dest: "{{ item.dest }}"
24+
remote_src: yes
25+
owner: "{{ __mailman3_web_user_name }}"
26+
group: "{{ __mailman3_web_group_name }}"
27+
loop:
28+
- { src: '/opt/github/ansible-managed/boost-mailman/hyperkitty/static/hyperkitty', dest: '{{ mailman3_web_var_dir }}/static_custom/' }
29+
- { src: '/opt/github/ansible-managed/boost-mailman/postorius/static/postorius', dest: '{{ mailman3_web_var_dir }}/static_custom/' }
30+
notify:
31+
- Restart mailman3-web service
32+
33+
- name: Copy boost templates
34+
ansible.builtin.copy:
35+
src: "{{ item.src }}"
36+
dest: "{{ item.dest }}"
37+
remote_src: yes
38+
owner: "{{ __mailman3_web_user_name }}"
39+
group: "{{ __mailman3_web_group_name }}"
40+
loop:
41+
- { src: '/opt/github/ansible-managed/boost-mailman/hyperkitty/templates/hyperkitty', dest: '{{ mailman3_web_var_dir }}/templates/' }
42+
- { src: '/opt/github/ansible-managed/boost-mailman/postorius/templates/postorius', dest: '{{ mailman3_web_var_dir }}/templates/' }
43+
notify:
44+
- Restart mailman3-web service
45+
46+
- name: Collect Django static files again in custom tasks
47+
community.general.django_manage:
48+
command: collectstatic
49+
settings: settings
50+
pythonpath: "{{ mailman3_django_project_dir }}"
51+
project_path: "{{ mailman3_django_project_dir }}"
52+
virtualenv: "{{ mailman3_install_dir }}"
53+
when: mailman3_install_method == "pip"
54+
55+
- name: Compress CSS again in custom tasks
56+
community.general.django_manage:
57+
command: compress
58+
settings: settings
59+
pythonpath: "{{ mailman3_django_project_dir }}"
60+
project_path: "{{ mailman3_django_project_dir }}"
61+
virtualenv: "{{ mailman3_install_dir }}"

0 commit comments

Comments
 (0)