mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-01 07:28:33 +02:00
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 0s
30 lines
1.0 KiB
YAML
Executable File
30 lines
1.0 KiB
YAML
Executable File
- name: Setup loki agent
|
|
become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
|
|
block:
|
|
- name: Get keys
|
|
ansible.builtin.command: |
|
|
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
|
|
changed_when: my_output.rc != 0
|
|
|
|
- name: Add repo
|
|
ansible.builtin.command: |
|
|
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
|
|
changed_when: my_output.rc != 0
|
|
|
|
- name: Update cache
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
|
|
- name: Instal wazuh
|
|
ansible.builtin.apt:
|
|
name: wazuh-agent
|
|
environment:
|
|
WAZUH_MANAGER: 'm-server.home.lan'
|
|
WAZUH_AGENT_NAME: "{{ inventory_hostname }}"
|
|
|
|
- name: Restart wazuh service
|
|
ansible.builtin.service:
|
|
name: wazuh-agent
|
|
state: restarted
|
|
enabled: true
|