Skip to content

Commit ab24604

Browse files
authored
Run logrotate only logrotate config changes (#302)
1 parent e2da68f commit ab24604

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

handlers/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040
name: unitd
4141
state: started
4242
enabled: yes
43+
44+
- name: "(Config: All OSs) Run Logrotate"
45+
command: logrotate -f /etc/logrotate.d/nginx

tasks/conf/logrotate.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,4 @@
3131
template:
3232
src: "logrotate/nginx.j2"
3333
dest: "/etc/logrotate.d/nginx"
34-
register: nginx_logrotate_result
35-
36-
- name: "(Config: All OSs) Run Logrotate"
37-
command: logrotate -f /etc/logrotate.d/nginx
38-
changed_when: nginx_logrotate_result.changed
34+
notify: "(Config: All OSs) Run Logrotate"

0 commit comments

Comments
 (0)