diff --git a/ansible-wazuh-agent/README.md b/ansible-wazuh-agent/README.md index 31538ff5..25f7fb2e 100644 --- a/ansible-wazuh-agent/README.md +++ b/ansible-wazuh-agent/README.md @@ -25,19 +25,23 @@ Playbook example The following is an example how this role can be used: - - hosts: all:!wazuh-manager - roles: - - ansible-wazuh-agent - vars: - wazuh_managers: - - address: 127.0.0.1 - port: 1514 - protocol: udp - wazuh_agent_authd: - enable: true - port: 1515 - ssl_agent_ca: null - ssl_auto_negotiate: 'no' + - hosts: all:!wazuh-manager + roles: + - ansible-wazuh-agent + vars: + wazuh_managers: + - address: 127.0.0.1 + port: 1514 + protocol: udp + api_port: 55000 + api_proto: 'http' + api_user: 'ansible' + wazuh_agent_authd: + enable: true + port: 1515 + ssl_agent_ca: null + ssl_auto_negotiate: 'no' + License and copyright --------------------- diff --git a/ansible-wazuh-agent/tasks/Linux.yml b/ansible-wazuh-agent/tasks/Linux.yml index 23440139..46ea72ca 100644 --- a/ansible-wazuh-agent/tasks/Linux.yml +++ b/ansible-wazuh-agent/tasks/Linux.yml @@ -97,6 +97,8 @@ when: - check_keys.stat.size == 0 - wazuh_managers.0.address is not none + - wazuh_managers.0.api_user is not none + - api_pass is not none delegate_to: localhost become: no tags: @@ -114,6 +116,8 @@ when: - check_keys.stat.size == 0 - wazuh_managers.0.address is not none + - wazuh_managers.0.api_user is not none + - api_pass is not none - newagent_api.json.error == 0 register: newagentkey_api delegate_to: localhost @@ -141,7 +145,7 @@ - api notify: restart wazuh-agent - when: wazuh_agent_authd.enable == false and ( wazuh_managers.0.api_user is defined and api_pass is defined ) + when: wazuh_agent_authd.enable == false - name: Linux | Vuls integration deploy (runs in background, can take a while) command: /var/ossec/wodles/vuls/deploy_vuls.sh {{ ansible_distribution|lower }} {{ ansible_distribution_major_version|int }}