diff --git a/handlers/main.yml b/handlers/main.yml index 8463e38..0b13edd 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -40,3 +40,6 @@ name: unitd state: started enabled: yes + +- name: "(Config: All OSs) Run Logrotate" + command: logrotate -f /etc/logrotate.d/nginx diff --git a/tasks/conf/logrotate.yml b/tasks/conf/logrotate.yml index ffff9ea..b6dff35 100644 --- a/tasks/conf/logrotate.yml +++ b/tasks/conf/logrotate.yml @@ -31,8 +31,4 @@ template: src: "logrotate/nginx.j2" dest: "/etc/logrotate.d/nginx" - register: nginx_logrotate_result - -- name: "(Config: All OSs) Run Logrotate" - command: logrotate -f /etc/logrotate.d/nginx - changed_when: nginx_logrotate_result.changed + notify: "(Config: All OSs) Run Logrotate"