Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1406 fix windows tasks to be compatible with check mode #1407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,21 @@
- wazuh_agent_status.stat.checksum != extracted_checksum.stdout_lines[0]
when:
- wazuh_winagent_config.check_sha512
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Install Agent if not already installed
win_package:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: present
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Check if client.keys exists
win_stat:
path: "{{ wazuh_agent_win_path }}client.keys"
register: check_windows_key
tags:
- config
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Register agent
win_shell: >
Expand All @@ -81,11 +84,13 @@
- wazuh_agent_authd.registration_address is not none
tags:
- config
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Check if ossec folder is accessible
win_file:
path: "{{ wazuh_agent_win_path }}"
state: directory
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Installing agent configuration (ossec.conf)
template: # noqa 208
Expand All @@ -107,8 +112,10 @@
win_file:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: absent
ignore_errors: "{{ ansible_check_mode }}"

- name: Windows | Delete downloaded checksum file
win_file:
path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}.sha512"
state: absent
ignore_errors: "{{ ansible_check_mode }}"