change installation directory (#116)
This commit is contained in:
parent
9327f052de
commit
e94a0cf473
@ -19,7 +19,10 @@ wazuh_notify_time: '10'
|
|||||||
wazuh_time_reconnect: '60'
|
wazuh_time_reconnect: '60'
|
||||||
wazuh_crypto_method: 'aes'
|
wazuh_crypto_method: 'aes'
|
||||||
wazuh_winagent_config:
|
wazuh_winagent_config:
|
||||||
install_dir: 'C:\wazuh-agent\'
|
install_dir: 'C:\Program Files\ossec-agent\'
|
||||||
|
install_dir_x86: 'C:\Program Files (x86)\ossec-agent\'
|
||||||
|
auth_path: C:\'Program Files'\ossec-agent\agent-auth.exe
|
||||||
|
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
|
||||||
version: '3.7.0'
|
version: '3.7.0'
|
||||||
revision: '1'
|
revision: '1'
|
||||||
repo: https://packages.wazuh.com/3.x/windows/
|
repo: https://packages.wazuh.com/3.x/windows/
|
||||||
|
|||||||
@ -1,8 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
- name: Windows | Check if Program Files (x86) exists
|
||||||
|
win_stat:
|
||||||
|
path: C:\Program Files (x86)
|
||||||
|
register: check_path
|
||||||
|
|
||||||
- name: Windows | Get current installed version
|
- name: Windows | Get current installed version
|
||||||
win_shell: "{{ wazuh_winagent_config.install_dir }}ossec-agent.exe -h"
|
win_shell: "{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}
|
||||||
|
{{ wazuh_winagent_config.install_dir }}{% endif %}ossec-agent.exe -h"
|
||||||
args:
|
args:
|
||||||
removes: "{{ wazuh_winagent_config.install_dir }}ossec-agent.exe"
|
removes: "{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}
|
||||||
|
{{ wazuh_winagent_config.install_dir }}{% endif %}ossec-agent.exe"
|
||||||
register: agent_version
|
register: agent_version
|
||||||
failed_when: False
|
failed_when: False
|
||||||
changed_when: False
|
changed_when: False
|
||||||
@ -34,12 +41,11 @@
|
|||||||
- name: Windows | Install Wazuh agent
|
- name: Windows | Install Wazuh agent
|
||||||
win_package:
|
win_package:
|
||||||
path: C:\wazuh-agent-installer.msi
|
path: C:\wazuh-agent-installer.msi
|
||||||
arguments: APPLICATIONFOLDER={{ wazuh_winagent_config.install_dir }}
|
|
||||||
when:
|
when:
|
||||||
- correct_version is not defined
|
- correct_version is not defined
|
||||||
|
|
||||||
- name: Windows | Check if client.keys exists
|
- name: Windows | Check if client.keys exists
|
||||||
win_stat: path="{{ wazuh_winagent_config.install_dir }}client.keys"
|
win_stat: path="{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}{{ wazuh_winagent_config.install_dir }}{% endif %}client.keys"
|
||||||
register: check_windows_key
|
register: check_windows_key
|
||||||
notify: restart wazuh-agent windows
|
notify: restart wazuh-agent windows
|
||||||
tags:
|
tags:
|
||||||
@ -52,12 +58,13 @@
|
|||||||
|
|
||||||
- name: Windows | Register agent
|
- name: Windows | Register agent
|
||||||
win_shell: >
|
win_shell: >
|
||||||
{{ wazuh_winagent_config.install_dir }}agent-auth.exe
|
{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.auth_path_x86 }}{% else %}
|
||||||
|
{{ wazuh_winagent_config.auth_path }}{% endif %}
|
||||||
-m {{ wazuh_managers.0.address }}
|
-m {{ wazuh_managers.0.address }}
|
||||||
-p {{ wazuh_agent_authd.port }}
|
-p {{ wazuh_agent_authd.port }}
|
||||||
{% if authd_pass is defined %} -P {{ authd_pass }}{% endif %}
|
{% if authd_pass is defined %} -P {{ authd_pass }}{% endif %}
|
||||||
args:
|
args:
|
||||||
chdir: "{{ wazuh_winagent_config.install_dir }}"
|
chdir: "{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}{{ wazuh_winagent_config.install_dir }}{% endif %}"
|
||||||
register: agent_auth_output
|
register: agent_auth_output
|
||||||
notify: restart wazuh-agent windows
|
notify: restart wazuh-agent windows
|
||||||
when:
|
when:
|
||||||
@ -70,7 +77,7 @@
|
|||||||
- name: Windows | Installing agent configuration (ossec.conf)
|
- name: Windows | Installing agent configuration (ossec.conf)
|
||||||
win_template:
|
win_template:
|
||||||
src: var-ossec-etc-ossec-agent.conf.j2
|
src: var-ossec-etc-ossec-agent.conf.j2
|
||||||
dest: "{{ wazuh_winagent_config.install_dir }}ossec.conf"
|
dest: "{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}{{ wazuh_winagent_config.install_dir }}{% endif %}ossec.conf"
|
||||||
notify: restart wazuh-agent windows
|
notify: restart wazuh-agent windows
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
@ -78,7 +85,7 @@
|
|||||||
- name: Windows | Installing local_internal_options.conf
|
- name: Windows | Installing local_internal_options.conf
|
||||||
win_template:
|
win_template:
|
||||||
src: var-ossec-etc-local-internal-options.conf.j2
|
src: var-ossec-etc-local-internal-options.conf.j2
|
||||||
dest: "{{ wazuh_winagent_config.install_dir }}local_internal_options.conf"
|
dest: "{% if check_path.stat.exists == true %}{{ wazuh_winagent_config.install_dir_x86 }}{% else %}{{ wazuh_winagent_config.install_dir }}{% endif %}local_internal_options.conf"
|
||||||
notify: restart wazuh-agent windows
|
notify: restart wazuh-agent windows
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user