ansible-logrotate icon indicating copy to clipboard operation
ansible-logrotate copied to clipboard

scripts, postrotate, multiple entries

Open tman77 opened this issue 6 years ago • 1 comments

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...

tman77 avatar Sep 26 '17 19:09 tman77

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

jewzaam avatar Nov 15 '17 18:11 jewzaam