mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 17:07:21 +00:00
use proxy to download wazuh agent
This commit is contained in:
1 parent
8b37bea135
commit
3a7fc1ddb5
1 file changed
+23
-4
@@ -17,12 +17,31 @@
|
||||
- wazuh_agent
|
||||
block:
|
||||
- name: Download agent
|
||||
win_shell: 'Invoke-WebRequest -Uri "{{ wazuh_url }}/{{ wazuh_msi }}" -OutFile "$env:temp\{{ wazuh_msi }}"'
|
||||
register: download_result
|
||||
win_get_url:
|
||||
url: "{{ wazuh_url }}/{{ wazuh_msi }}"
|
||||
dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
|
||||
when: |
|
||||
inventory_hostname not in groups['meta-type_client'] or
|
||||
project_zone == 'standard'
|
||||
|
||||
- name: Download agent using proxy
|
||||
vars:
|
||||
proxy_ip: "{{ os_project }}-{{ win_project }}-proxy"
|
||||
win_get_url:
|
||||
url: "{{ wazuh_url }}/{{ wazuh_msi }}"
|
||||
dest: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
|
||||
when: |
|
||||
inventory_hostname in groups['meta-type_client'] and
|
||||
project_zone == 'protected'
|
||||
|
||||
- name: Install agent
|
||||
win_shell: 'msiexec.exe /i $env:temp\{{ wazuh_msi }} /q WAZUH_MANAGER="{{ wazuh_server }}" WAZUH_REGISTRATION_SERVER="{{ wazuh_server }}"'
|
||||
when: download_result.rc == 0
|
||||
win_package:
|
||||
path: "C:\\Users\\Administrator\\AppData\\Local\\Temp{{ wazuh_msi }}"
|
||||
arguments:
|
||||
- /q
|
||||
- WAZUH_MANAGER={{ wazuh_server }}
|
||||
- WAZUH_REGISTRATION_SERVER={{ wazuh_server }}
|
||||
state: present
|
||||
|
||||
- name: Start Service
|
||||
win_service:
|
||||
|
||||
Reference in new issue
Block a user