roles/wazuh-agent: fix erroneous usage of ansible_host instead of inventory_hostname

This commit is contained in:
neonmei 2020-11-26 16:34:25 -03:00
parent 01318200de
commit 4d2e493cef
No known key found for this signature in database
GPG Key ID: 7EA1832E7E17237E

View File

@ -133,7 +133,7 @@
force_basic_auth: yes force_basic_auth: yes
validate_certs: '{{ target_manager.validate_certs | default(false) }}' validate_certs: '{{ target_manager.validate_certs | default(false) }}'
no_log: '{{ wazuh_agent_nolog_sensible | bool }}' no_log: '{{ wazuh_agent_nolog_sensible | bool }}'
delegate_to: '{{ ansible_host if wazuh_api_reachable_from_agent else "localhost" }}' delegate_to: '{{ inventory_hostname if wazuh_api_reachable_from_agent else "localhost" }}'
changed_when: api_jwt_result.json.error == 0 changed_when: api_jwt_result.json.error == 0
register: api_jwt_result register: api_jwt_result
become: no become: no