From 6bd7c2d0d6d560cb8c94e0c1a1f19def80457929 Mon Sep 17 00:00:00 2001 From: Colin Hoglund Date: Fri, 1 Jun 2018 16:34:51 -0400 Subject: [PATCH] only report changed when link fails, remove tests as filters deprecation warning --- tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 80e90e8..3b2518b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,8 +16,9 @@ - name: Check agent link status command: /opt/nessus_agent/sbin/nessuscli agent status become: yes - ignore_errors: yes register: nessus_link + ignore_errors: yes + changed_when: nessus_link.rc != 0 - name: Configure Nessus Agent command: > @@ -27,7 +28,7 @@ --port={{nessus_agent_port}} --groups="{{nessus_agent_group}}" become: yes - when: nessus_link|failed + when: nessus_link is failed notify: restart nessusagent - name: Ensure nessusagent is started