Closed tibz7 closed 1 year ago
Hey @tibz7 -- I cannot reproduce this error.
When I use the following playbook:
---
- name: Converge
hosts: all
tasks:
- name: Install NGINX
ansible.builtin.include_role:
name: nginxinc.nginx
vars:
nginx_logrotate_conf_enable: true
nginx_logrotate_conf:
paths:
- /var/log/nginx/*.log
options:
- daily
This is what I get:
[root@debian-bookworm /]# cat /etc/logrotate.d/nginx
/var/log/nginx/*.log
{
daily
postrotate
nginx -s reopen
endscript
}
But I can reproduce the error when I run this playbook:
---
- name: Converge
hosts: all
tasks:
- name: Install NGINX
ansible.builtin.include_role:
name: nginxinc.nginx
vars:
nginx_logrotate_conf_enable: true
nginx_logrotate_conf:
paths:
- /var/log/nginx/*.log
options: daily
options
expects a list/array, not a single word. That being said, I'll create a PR to fix this edge case, but for next time, try to follow the pattern showcased in the defaults/
directory as closely as possible to avoid issues like this 😄
Describe the bug
logrotate "daily" is badly formatted
To reproduce
cat /etc/logrotate.d/nginx