Agent package is downloaded and deleted

This commit is contained in:
David Correa Rodríguez 2023-10-03 17:16:38 +02:00
parent e1568d00eb
commit 4ef5c37970
No known key found for this signature in database
GPG Key ID: 8787C7C9FF271262
2 changed files with 16 additions and 2 deletions

View File

@ -56,7 +56,7 @@ wazuh_winagent_config:
# macOS deployment # macOS deployment
wazuh_macos_config: wazuh_macos_config:
download_dir: / download_dir: /tmp/
install_dir: /Library/Ossec/ install_dir: /Library/Ossec/
wazuh_dir: "/var/ossec" wazuh_dir: "/var/ossec"

View File

@ -15,4 +15,18 @@
- name: macOS | Check if Wazuh installer is already downloaded - name: macOS | Check if Wazuh installer is already downloaded
stat: stat:
path: "{{ wazuh_macos_config.download_dir }}{{ wazuh_macos_package_name }}" path: "{{ wazuh_macos_config.download_dir }}{{ wazuh_macos_package_name }}"
register: wazuh_package_downloaded register: wazuh_package_downloaded
- name: macOS | Download Wazuh Agent package
get_url:
url: "{{ wazuh_macos_package_url }}"
dest: "{{ wazuh_macos_config.download_dir }}"
when:
- not wazuh_package_downloaded.stat.exists
- name: macOS | Delete downloaded Wazuh agent installer file
file:
path: "{{ wazuh_macos_config.download_dir }}{{ wazuh_macos_package_name }}"
state: absent
when:
- wazuh_package_downloaded.stat.exists