Added tasks to verify SHA512 checksum
This commit is contained in:
parent
86fb18a0c5
commit
06314eb8f9
@ -30,16 +30,29 @@
|
||||
when:
|
||||
- not wazuh_package_downloaded.stat.exists
|
||||
|
||||
- name: Windows | Download SHA512 checksum file
|
||||
win_get_url:
|
||||
url: "{{ wazuh_winagent_sha512_url }}"
|
||||
dest: "{{ wazuh_winagent_config.download_dir }}"
|
||||
when:
|
||||
- not wazuh_package_downloaded.stat.exists
|
||||
|
||||
- name: Extract checksum from SHA512 file
|
||||
win_shell: Get-Content "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}.sha512" | ForEach-Object { $_.Split(' ')[0] }
|
||||
register: extracted_checksum
|
||||
when:
|
||||
- not wazuh_package_downloaded.stat.exists
|
||||
|
||||
- name: Windows | Verify the Wazuh Agent installer
|
||||
win_stat:
|
||||
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
|
||||
get_checksum: true
|
||||
checksum_algorithm: md5
|
||||
checksum_algorithm: sha512
|
||||
register: wazuh_agent_status
|
||||
failed_when:
|
||||
- wazuh_agent_status.stat.checksum != wazuh_winagent_config.md5
|
||||
- wazuh_agent_status.stat.checksum != extracted_checksum.stdout
|
||||
when:
|
||||
- wazuh_winagent_config.check_md5
|
||||
- wazuh_winagent_config.check_sha512
|
||||
|
||||
|
||||
- name: Windows | Install Agent if not already installed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user