2024-12-15 22:54:29 +01:00
- block :
- name : Get keys
ansible.builtin.shell : curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg
- name : Add repo
ansible.builtin.shell : echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
2024-12-19 15:58:29 +01:00
- name : Update cache
2024-12-15 22:54:29 +01:00
ansible.builtin.apt :
update_cache : true
2024-12-19 15:58:29 +01:00
- name : Instal wazuh
ansible.builtin.apt :
name : wazuh-agent
environment :
WAZUH_MANAGER : 'm-server.home.lan'
WAZUH_AGENT_NAME : "{{ inventory_hostname}}"
2024-12-15 22:54:29 +01:00
- name : Restart wazuh service
ansible.builtin.service :
name : wazuh-agent
state : restarted
enabled : true
become : true