From 55e943bd24b0314c8899dd768db75dd40c8fc52e Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 19 Dec 2024 15:58:29 +0100 Subject: [PATCH] initial --- desktop.yml | 4 +++- roles/mqtt-srv/tasks/main.yml | 2 +- roles/wazuh-agent/tasks/main.yml | 12 +++++++----- servers.yml | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/desktop.yml b/desktop.yml index c3b6309..2b38c16 100755 --- a/desktop.yml +++ b/desktop.yml @@ -14,4 +14,6 @@ - role: ldap_client tags: ldap_client - role: wazuh-agent - tags: wazuh-agent \ No newline at end of file + tags: wazuh-agent + - role: mqtt-srv + tags: mqtt-srv \ No newline at end of file diff --git a/roles/mqtt-srv/tasks/main.yml b/roles/mqtt-srv/tasks/main.yml index 0b0b66c..e402bf8 100755 --- a/roles/mqtt-srv/tasks/main.yml +++ b/roles/mqtt-srv/tasks/main.yml @@ -1,7 +1,7 @@ - block: - name: include vault ansible.builtin.include_vars: - file: ../jaydee.yml + file: jaydee.yml - name: Delete content & directory ansible.builtin.file: state: absent diff --git a/roles/wazuh-agent/tasks/main.yml b/roles/wazuh-agent/tasks/main.yml index aaa2a12..996fe97 100755 --- a/roles/wazuh-agent/tasks/main.yml +++ b/roles/wazuh-agent/tasks/main.yml @@ -1,15 +1,17 @@ - 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 + - name: Update cache ansible.builtin.apt: update_cache: true - - name: Add repo - ansible.builtin.shell: WAZUH_MANAGER="192.168.77.101" apt-get install wazuh-agent - + - 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 diff --git a/servers.yml b/servers.yml index 1d893b3..bb906d3 100755 --- a/servers.yml +++ b/servers.yml @@ -22,4 +22,6 @@ - name: ssh_banner tags: ssh_banner - name: omv_backup - tags: omv_backup \ No newline at end of file + tags: omv_backup + - name: wazuh-agent + tags: wazuh-agent \ No newline at end of file