File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.24.3 (Unreleased)
4
+
5
+ ENHANCEMENTS:
6
+
7
+ - Allow strings in addition to a list when configuring ` logrotate ` .
8
+
3
9
## 0.24.2 (October 3rd, 2023)
4
10
5
11
FEATURES:
Original file line number Diff line number Diff line change 2
2
# Create custom logrotate config
3
3
nginx_logrotate_conf_enable : false
4
4
nginx_logrotate_conf :
5
- paths :
6
- - /var/log/nginx/*.log
7
- options :
5
+ paths : /var/log/nginx/*.log # String or list of strings
6
+ # - /var/log/nginx/*.log
7
+ options : # daily # String or a list of strings
8
8
- daily
9
9
- missingok
10
10
- rotate 14
11
11
- compress
12
12
- delaycompress
13
13
- notifempty
14
- - create 0644 www-data adm # Changes nginx logs permissions
14
+ - create 0644 www-data adm # Changes NGINX log permissions
15
15
- sharedscripts
Original file line number Diff line number Diff line change 16
16
nginx_service_timeout : 95
17
17
nginx_logrotate_conf_enable : true
18
18
nginx_logrotate_conf :
19
- paths :
20
- - /var/log/nginx/*.log
19
+ paths : /var/log/nginx/*.log
21
20
options :
22
21
- daily
23
22
- missingok
Original file line number Diff line number Diff line change 1
- {% for path in nginx_logrotate_conf .paths %}
1
+ {% if nginx_logrotate_conf ['paths' ] is defined and nginx_logrotate_conf ['paths' ] is not mapping %}
2
+ {% for path in nginx_logrotate_conf ['paths' ] if nginx_logrotate_conf ['paths' ] is not string %}
2
3
{{ path }}
4
+ {% else %}
5
+ {{ nginx_logrotate_conf['paths'] }}
3
6
{% endfor %}
7
+ {% - endif %}
4
8
{
5
- {% for option in nginx_logrotate_conf .options %}
9
+ {% if nginx_logrotate_conf ['options' ] is defined and nginx_logrotate_conf ['options' ] is not mapping %}
10
+ {% for option in nginx_logrotate_conf ['options' ] if nginx_logrotate_conf ['options' ] is not string %}
6
11
{{ option }}
12
+ {% else %}
13
+ {{ nginx_logrotate_conf['options'] }}
7
14
{% endfor %}
15
+ {% - endif %}
8
16
postrotate
9
17
{% if ansible_facts ['os_family' ] == "Debian" %}
10
18
if [ -f /var/run/nginx.pid ]; then
You can’t perform that action at this time.
0 commit comments