Merge pull request #368 from wazuh/feature-367-windows-package-url

Allow custom URLs for Windows Wazuh Agent installation
This commit is contained in:
Jose M. Garcia 2020-02-20 15:06:24 +01:00 committed by GitHub
commit 7c874a15ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -60,10 +60,9 @@ wazuh_winagent_config:
auth_path: C:\Program Files\ossec-agent\agent-auth.exe auth_path: C:\Program Files\ossec-agent\agent-auth.exe
# Adding quotes to auth_path_x86 since win_shell outputs error otherwise # Adding quotes to auth_path_x86 since win_shell outputs error otherwise
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
version: '3.11.3'
revision: '1'
repo: https://packages.wazuh.com/3.x/windows/
md5: e4623e7cd3f2fc6ac8a313cbdd7c3cba md5: e4623e7cd3f2fc6ac8a313cbdd7c3cba
wazuh_winagent_config_url: https://packages.wazuh.com/3.x/windows/wazuh-agent-3.11.3-1.msi
wazuh_winagent_package_name: wazuh-agent-3.11.3-1.msi
wazuh_agent_config: wazuh_agent_config:
repo: repo:
apt: 'deb https://packages.wazuh.com/3.x/apt/ stable main' apt: 'deb https://packages.wazuh.com/3.x/apt/ stable main'

View File

@ -20,19 +20,19 @@
- name: Windows | Check if Wazuh installer is already downloaded - name: Windows | Check if Wazuh installer is already downloaded
win_stat: win_stat:
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi" path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
register: wazuh_package_downloaded register: wazuh_package_downloaded
- name: Windows | Download Wazuh Agent package - name: Windows | Download Wazuh Agent package
win_get_url: win_get_url:
url: "{{ wazuh_winagent_config.repo }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi" url: "{{ wazuh_winagent_config_url }}"
dest: "{{ wazuh_winagent_config.download_dir }}" dest: "{{ wazuh_winagent_config.download_dir }}"
when: when:
- not wazuh_package_downloaded.stat.exists - not wazuh_package_downloaded.stat.exists
- name: Windows | Verify the Wazuh Agent installer - name: Windows | Verify the Wazuh Agent installer
win_stat: win_stat:
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi" path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
get_checksum: true get_checksum: true
checksum_algorithm: md5 checksum_algorithm: md5
register: wazuh_agent_status register: wazuh_agent_status
@ -41,11 +41,12 @@
- name: Windows | Install Agent if not already installed - name: Windows | Install Agent if not already installed
win_package: win_package:
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi" path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: present state: present
- name: Windows | Check if client.keys exists - name: Windows | Check if client.keys exists
win_stat: path="{{ wazuh_agent_win_path }}client.keys" win_stat:
path: "{{ wazuh_agent_win_path }}client.keys"
register: check_windows_key register: check_windows_key
tags: tags:
- config - config
@ -94,5 +95,5 @@
- name: Windows | Delete downloaded Wazuh agent installer file - name: Windows | Delete downloaded Wazuh agent installer file
win_file: win_file:
path: "{{ wazuh_winagent_config.download_dir }}wazuh-agent-{{ wazuh_winagent_config.version }}-{{ wazuh_winagent_config.revision }}.msi" path: "{{ wazuh_winagent_config.download_dir }}{{ wazuh_winagent_package_name }}"
state: absent state: absent