From 953bff736d957e4710d3c2e453d82e94547687fe Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 15 Dec 2024 22:54:29 +0100 Subject: [PATCH] initial --- roles/wazuh-agent/tasks/main.yml | 19 +++++++++++++++++++ roles/wazuh-agent/vars/main.yml | 1 + 2 files changed, 20 insertions(+) create mode 100755 roles/wazuh-agent/tasks/main.yml create mode 100755 roles/wazuh-agent/vars/main.yml diff --git a/roles/wazuh-agent/tasks/main.yml b/roles/wazuh-agent/tasks/main.yml new file mode 100755 index 0000000..aaa2a12 --- /dev/null +++ b/roles/wazuh-agent/tasks/main.yml @@ -0,0 +1,19 @@ +- 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 + - name: Install docker + ansible.builtin.apt: + update_cache: true + - name: Add repo + ansible.builtin.shell: WAZUH_MANAGER="192.168.77.101" apt-get install wazuh-agent + + - name: Restart wazuh service + ansible.builtin.service: + name: wazuh-agent + state: restarted + enabled: true + + become: true \ No newline at end of file diff --git a/roles/wazuh-agent/vars/main.yml b/roles/wazuh-agent/vars/main.yml new file mode 100755 index 0000000..e95fa5e --- /dev/null +++ b/roles/wazuh-agent/vars/main.yml @@ -0,0 +1 @@ +ZABBIX_SERVER: "zabbix.home.lan" \ No newline at end of file