ansible-logrotate
ansible-logrotate copied to clipboard
scripts, postrotate, multiple entries
I am trying to use this role to set the log owner and permissions, but I am using copytruncate, so I can't use the create directive.
Is there a way to do it in scripts, postrotate. When I tested, it only allows one entry for postrotate I believe because it is a dict object.
i.e.
scripts:
postrotate: chown app:app /mnt/log/test/*.log
postrotate: chmod 0644 /mnt/log/test/*.log
If I run the above, only the chmod line is applied when the playbook is run...
Haven't used this role yet, but have you tried:
scripts:
postrotate: chown app:app /mnt/log/test/*.log && chmod 0644 /mnt/log/test/*.log