Update Wazuh installation tasks. Added Product key to avoid reinstalling Agent
This commit is contained in:
parent
9f84bfe15a
commit
ea69b7fc9b
@ -18,34 +18,36 @@
|
||||
when:
|
||||
- not check_path.stat.exists
|
||||
|
||||
- name: Windows | Downloading windows Wazuh agent installer
|
||||
win_get_url:
|
||||
dest: C:\wazuh-agent-installer.msi
|
||||
url: "{{ wazuh_winagent_config.repo }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi"
|
||||
when:
|
||||
- correct_version is not defined
|
||||
|
||||
- name: Windows | Verify the downloaded Wazuh agent installer
|
||||
- name: Windows | Check if Wazuh installer is already downloaded
|
||||
win_stat:
|
||||
path: C:\wazuh-agent-installer.msi
|
||||
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi"
|
||||
register: wazuh_package_downloaded
|
||||
|
||||
- name: Windows | Download Wazuh Agent package
|
||||
win_get_url:
|
||||
url: "{{ wazuh_winagent_config.repo }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi"
|
||||
dest: "{{ wazuh_winagent_config.download_dir }}"
|
||||
when:
|
||||
- not wazuh_package_downloaded.stat.exists
|
||||
|
||||
- name: Windows | Verify the Wazuh Agent installer
|
||||
win_stat:
|
||||
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi"
|
||||
get_checksum: true
|
||||
checksum_algorithm: md5
|
||||
register: installer_md5
|
||||
when:
|
||||
- correct_version is not defined
|
||||
register: wazuh_agent_status
|
||||
failed_when:
|
||||
- installer_md5.stat.checksum != wazuh_winagent_config.md5
|
||||
- wazuh_agent_status.stat.checksum != wazuh_winagent_config.md5
|
||||
|
||||
- name: Windows | Install Wazuh agent
|
||||
- name: Windows | Install Agent if not already installed
|
||||
win_package:
|
||||
path: C:\wazuh-agent-installer.msi
|
||||
when:
|
||||
- correct_version is not defined
|
||||
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi"
|
||||
product_id: '{9903C258-FC1E-4886-B7DB-1535976EC1D5}'
|
||||
state: present
|
||||
|
||||
- name: Windows | Check if client.keys exists
|
||||
win_stat: path="{{ wazuh_agent_win_path }}"
|
||||
win_stat: path="{{ wazuh_agent_win_path }}client.keys"
|
||||
register: check_windows_key
|
||||
notify: restart wazuh-agent windows
|
||||
tags:
|
||||
- config
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user