Skip to content

Commit 654d016

Browse files
committed
wrapper convenience scripts
1 parent 5fbf301 commit 654d016

File tree

7 files changed

+33
-1
lines changed

7 files changed

+33
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.swp
22
tasks/custom
3+
.ansible

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ __mailman3_web_user:
9696
comment: "Mailman Web Services"
9797
home: "{{ mailman3_web_var_dir }}"
9898
system: true
99+
shell: "/bin/bash"
99100

100101
# The default web user if installing with packages. This is the standard Debian web server user, since this is what the
101102
# packages expect.

tasks/database/postgres.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
role: "{{ item.additional_readonly_users }}"
143143
when: item.additional_readonly_users is defined
144144

145-
146145
- name: Multiple databases configure pg_hba
147146
with_items: "{{ mailman3_database_list }}"
148147
ansible.builtin.lineinfile:

tasks/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@
7979
state: started
8080
when: mailman3_process_manager != "supervisor"
8181

82+
- name: Install wrapper convenience scripts
83+
ansible.builtin.template:
84+
src: "{{ item.src }}"
85+
dest: "{{ item.dest }}"
86+
mode: "0755"
87+
owner: "root"
88+
group: "root"
89+
loop:
90+
- src: mailman-wrapper.j2
91+
dest: "/usr/local/bin/mailman-wrapper"
92+
- src: list-wrapper.j2
93+
dest: "/usr/local/bin/list-wrapper"
94+
- src: mailman-web-wrapper.j2
95+
dest: "/usr/local/bin/mailman-web-wrapper"
96+
8297
- name: Customizations
8398
ansible.builtin.include_tasks:
8499
file: "{{ item }}"

templates/list-wrapper.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
su -s /bin/sh -c "$*" {{ __mailman3_core_user_name }}

templates/mailman-web-wrapper.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
MAILMAN_WEB_USER="{{ __mailman3_web_user_name }}"
4+
MAILMAN_WEB_EXECUTABLE="{{ mailman3_install_dir }}/bin/mailman-web"
5+
MAILMAN_WEB_CONFIG="{{ mailman3_django_project_dir }}/settings.py"
6+
7+
su -s /bin/sh -c "MAILMAN_WEB_CONFIG=${MAILMAN_WEB_CONFIG} ${MAILMAN_WEB_EXECUTABLE} $*" ${MAILMAN_WEB_USER}

templates/mailman-wrapper.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
MAILMAN_CORE_USER="{{ __mailman3_core_user_name }}"
4+
MAILMAN_CORE_EXECUTABLE="{{ mailman3_install_dir }}/bin/mailman"
5+
6+
su -s /bin/sh -c "${MAILMAN_CORE_EXECUTABLE} $*" ${MAILMAN_CORE_USER}

0 commit comments

Comments
 (0)