From 7a1b3315680f4256401f710796d63796bb3c6a41 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Mon, 22 Jul 2024 15:21:00 -0800 Subject: [PATCH] style: Tweak Ansible handlers (#749) --- handlers/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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