Skip to content

Commit

Permalink
style: Tweak Ansible handlers (nginxinc#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg authored Jul 22, 2024
1 parent 096be1d commit 7a1b331
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7a1b331

Please sign in to comment.