File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ mailman3_core_var_dir: /var/lib/mailman3
31
31
# Mailman Core logs
32
32
mailman3_core_log_dir : /var/log/mailman3
33
33
34
+ # Mailman Web logs (in this case Crons)
35
+ mailman3_web_log_dir : /var/log/mailman3-web
36
+
34
37
# Mailman Web Interface configuration files, project, and data
35
38
mailman3_web_var_dir : " {{ mailman3_core_var_dir }}/web"
36
39
@@ -219,6 +222,18 @@ mailman3_logrotate_config:
219
222
- su - {{ __mailman3_core_user_name }} -s /bin/sh -c "{{ mailman3_install_dir }}/bin/mailman -C {{ mailman3_core_etc_dir }}/mailman.cfg reopen"
220
223
# endscript is automatically appended
221
224
225
+ # Mailman3 Core log rotation configuration
226
+ mailman3_web_logrotate_config :
227
+ - weekly
228
+ - rotate 4
229
+ - compress
230
+ - maxsize 100M
231
+ - missingok
232
+ - notifempty
233
+ - sharedscripts
234
+ - delaycompress
235
+ # endscript is automatically appended
236
+
222
237
#
223
238
# Mailman Web Interface configuration
224
239
#
Original file line number Diff line number Diff line change 109
109
user : " {{ __mailman3_web_user_name }}"
110
110
minute : " {{ item.minute | default(omit) }}"
111
111
special_time : " {{ item.special_time | default(omit) }}"
112
- job : " MAILMAN_WEB_CONFIG={{ mailman3_django_project_dir }}/settings.py {{ mailman3_install_dir }}/bin/mailman-web runjobs {{ item.name | default(item.special_time) }} > {{ item.name | default(item.special_time) }}.txt 2>&1"
112
+ job : " ( date && MAILMAN_WEB_CONFIG={{ mailman3_django_project_dir }}/settings.py {{ mailman3_install_dir }}/bin/mailman-web runjobs {{ item.name | default(item.special_time) }} ) >> {{ mailman3_web_log_dir }}/{{ item.name | default(item.special_time) }}.log 2>&1"
113
113
loop :
114
114
- special_time : hourly
115
115
- special_time : daily
Original file line number Diff line number Diff line change 47
47
- path : " {{ mailman3_core_log_dir }}"
48
48
owner : " {{ __mailman3_core_user_name }}"
49
49
group : " {{ __mailman3_core_group_name }}"
50
+ - path : " {{ mailman3_web_log_dir }}"
51
+ owner : " {{ __mailman3_web_user_name }}"
52
+ group : " {{ __mailman3_web_group_name }}"
50
53
mode : " 0755"
51
54
- path : " {{ mailman3_web_var_dir }}"
52
55
owner : " {{ __mailman3_web_user_name }}"
121
124
dest : /etc/logrotate.d/mailman3-core
122
125
mode : " 0644"
123
126
127
+ - name : Install Mailman Web logrotate configuration
128
+ ansible.builtin.template :
129
+ src : logrotate-mailman3-web.j2
130
+ dest : /etc/logrotate.d/mailman3-web
131
+ mode : " 0644"
132
+
124
133
# TODO: remove the non-instance service unit file if mailman3_domains is defined, remove the instance service unit file
125
134
126
135
- name : Create Django settings file
Original file line number Diff line number Diff line change
1
+ ##
2
+ ## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
3
+ ##
4
+ {{ mailman3_web_log_dir }}/*.log {
5
+ {% for opt in mailman 3_web_logrotate_config %}
6
+ {% if opt is mapping %}
7
+ {% set key , val = opt .items () | first %}
8
+ {{ key }}
9
+ {% for subopt in val %}
10
+ {{ subopt }}
11
+ {% endfor %}
12
+ endscript
13
+ {% else %}
14
+ {{ opt }}
15
+ {% endif %}
16
+ {% endfor %}
17
+ }
You can’t perform that action at this time.
0 commit comments