Skip to content

Commit 2164dd5

Browse files
committed
Ansible custom tasks
1 parent eaa9c9d commit 2164dd5

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

ansible/README.md

Lines changed: 5 additions & 0 deletions
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

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

0 commit comments

Comments
 (0)