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 11# Changelog
22
3+ ## 0.24.3 (Unreleased)
4+
5+ ENHANCEMENTS:
6+
7+ - Allow strings in addition to a list when configuring ` logrotate ` .
8+
39## 0.24.2 (October 3rd, 2023)
410
511FEATURES:
Original file line number Diff line number Diff line change 22# Create custom logrotate config
33nginx_logrotate_conf_enable : false
44nginx_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
88 - daily
99 - missingok
1010 - rotate 14
1111 - compress
1212 - delaycompress
1313 - notifempty
14- - create 0644 www-data adm # Changes nginx logs permissions
14+ - create 0644 www-data adm # Changes NGINX log permissions
1515 - sharedscripts
Original file line number Diff line number Diff line change 1616 nginx_service_timeout : 95
1717 nginx_logrotate_conf_enable : true
1818 nginx_logrotate_conf :
19- paths :
20- - /var/log/nginx/*.log
19+ paths : /var/log/nginx/*.log
2120 options :
2221 - daily
2322 - 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 %}
23{{ path }}
4+ {% else %}
5+ {{ nginx_logrotate_conf['paths'] }}
36{% endfor %}
7+ {% - endif %}
48{
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 %}
611 {{ option }}
12+ {% else %}
13+ {{ nginx_logrotate_conf['options'] }}
714{% endfor %}
15+ {% - endif %}
816 postrotate
917{% if ansible_facts ['os_family' ] == "Debian" %}
1018 if [ -f /var/run/nginx.pid ]; then
You can’t perform that action at this time.
0 commit comments