From 90dacea946436c1b320bc0f18b646dd76a40ef34 Mon Sep 17 00:00:00 2001 From: Miguelangel Freitas Date: Mon, 21 Aug 2017 19:09:17 -0400 Subject: [PATCH] Verify agent registration when is need it. --- ansible-wazuh-agent/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible-wazuh-agent/tasks/main.yml b/ansible-wazuh-agent/tasks/main.yml index c9af9802..bba005aa 100644 --- a/ansible-wazuh-agent/tasks/main.yml +++ b/ansible-wazuh-agent/tasks/main.yml @@ -28,7 +28,10 @@ - name: Verify agent registration shell: echo {{ agent_auth_output }} | grep "Valid key created" - when: wazuh_register_client == true + when: + - wazuh_register_client == true + - check_keys.stat.size == 0 + - wazuh_manager_ip is not none tags: - config