diff --git a/handlers/main.yml b/handlers/main.yml index 61c51ad2e..bbfbac0bb 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -28,7 +28,7 @@ - name: (Handler) Print NGINX error if syntax check fails ansible.builtin.debug: - var: config_check.stderr_lines + var: config_check['stderr_lines'] failed_when: config_check['rc'] != 0 when: - config_check['stderr_lines'] is defined @@ -50,8 +50,7 @@ enabled: true - name: (Handler) Start logrotate - ansible.builtin.command: - cmd: logrotate -f /etc/logrotate.d/nginx + ansible.builtin.command: logrotate -f /etc/logrotate.d/nginx register: logrotate_check ignore_errors: true check_mode: false @@ -60,7 +59,7 @@ - name: (Handler) Print logrotate error if config check fails ansible.builtin.debug: - var: logrotate_check.stderr_lines + var: logrotate_check['stderr_lines'] failed_when: logrotate_check['rc'] != 0 when: - logrotate_check['stderr_lines'] is defined