Run logrotate only logrotate config changes (#302)

This commit is contained in:
Seena Fallah 2020-08-20 04:20:22 +04:30 committed by GitHub
parent e2da68f875
commit ab24604454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -40,3 +40,6 @@
name: unitd name: unitd
state: started state: started
enabled: yes enabled: yes
- name: "(Config: All OSs) Run Logrotate"
command: logrotate -f /etc/logrotate.d/nginx

View File

@ -31,8 +31,4 @@
template: template:
src: "logrotate/nginx.j2" src: "logrotate/nginx.j2"
dest: "/etc/logrotate.d/nginx" dest: "/etc/logrotate.d/nginx"
register: nginx_logrotate_result notify: "(Config: All OSs) Run Logrotate"
- name: "(Config: All OSs) Run Logrotate"
command: logrotate -f /etc/logrotate.d/nginx
changed_when: nginx_logrotate_result.changed