Merge pull request #421 from wazuh/feature-126-delegate-registration
Test #127 agent registration
This commit is contained in:
commit
0f338ed638
@ -73,7 +73,6 @@
|
||||
path: "{{ filebeat_module_folder }}"
|
||||
register: filebeat_module_folder
|
||||
|
||||
|
||||
- name: Download Filebeat module package
|
||||
get_url:
|
||||
url: "{{ filebeat_module_package_url }}/{{ filebeat_module_package_name }}"
|
||||
|
||||
@ -39,6 +39,7 @@ wazuh_managers:
|
||||
api_port: 55000
|
||||
api_proto: 'http'
|
||||
api_user: null
|
||||
wazuh_api_reachable_from_agent: false
|
||||
wazuh_profile_centos: 'centos, centos7, centos7.6'
|
||||
wazuh_profile_ubuntu: 'ubuntu, ubuntu18, ubuntu18.04'
|
||||
wazuh_auto_restart: 'yes'
|
||||
|
||||
@ -123,15 +123,15 @@
|
||||
user: "{{ wazuh_managers.0.api_user }}"
|
||||
password: "{{ api_pass }}"
|
||||
register: newagent_api
|
||||
notify: restart wazuh-agent
|
||||
# changed_when: newagent_api.json.error == 0
|
||||
vars:
|
||||
agent_name: "{% if single_agent_name is defined %}{{ single_agent_name }}{% else %}{{ inventory_hostname }}{% endif %}"
|
||||
delegate_to: "{{ 'localhost' if not wazuh_api_reachable_from_agent else inventory_hostname }}"
|
||||
become: no
|
||||
changed_when: newagent_api.json.error == 0
|
||||
when:
|
||||
- not check_keys.stat.exists or check_keys.stat.size == 0
|
||||
- wazuh_agent_authd.registration_address is not none
|
||||
become: false
|
||||
ignore_errors: true
|
||||
- wazuh_managers.0.address is not none
|
||||
tags:
|
||||
- config
|
||||
- api
|
||||
|
||||
- name: Linux | Retieve new agent data via rest-API
|
||||
uri:
|
||||
@ -148,8 +148,11 @@
|
||||
- wazuh_agent_authd.registration_address is not none
|
||||
- newagent_api.json.error == 0
|
||||
register: newagentdata_api
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
delegate_to: "{{ 'localhost' if not wazuh_api_reachable_from_agent else inventory_hostname }}"
|
||||
become: no
|
||||
tags:
|
||||
- config
|
||||
- api
|
||||
|
||||
- name: Linux | Register agent (via rest-API)
|
||||
command: /var/ossec/bin/manage_agents
|
||||
|
||||
Loading…
Reference in New Issue
Block a user