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

Enhance macOS deployment ansible taks #4685

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.
wazuh_winagent_package_name: wazuh-agent-4.8.0-1.msi
wazuh_winagent_package_name_generic: wazuh-agent.msi
wazuh_dir: "/var/ossec"
macos_wazuh_dir: "/Library/Ossec"

# This is deprecated, see: wazuh_agent_address
wazuh_agent_nat: false
Expand Down
45 changes: 45 additions & 0 deletions provisioning/roles/wazuh/ansible-wazuh-agent/tasks/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,48 @@

- include_tasks: "installation_from_custom_packages.yml"
when: wazuh_custom_packages_installation_agent_enabled

- name: macOS | Installing agent configuration (ossec.conf)
template:
src: var-ossec-etc-ossec-agent.conf.j2
dest: "{{ macos_wazuh_dir }}/etc/ossec.conf"
owner: root
group: wazuh
mode: 0644
notify: restart wazuh-agent
tags:
- init
- config

- name: macOS | Check if client.keys exists
stat:
path: "{{ macos_wazuh_dir }}/etc/client.keys"
register: client_keys_file
tags:
- config

- name: macOS | Installing local_internal_options.conf
template:
src: var-ossec-etc-local-internal-options.conf.j2
dest: "{{ macos_wazuh_dir }}/etc/local_internal_options.conf"
owner: root
group: wazuh
mode: 0640
notify: restart wazuh-agent
tags:
- init
- config

- name: Create auto-enrollment password file
template:
src: authd_pass.j2
dest: "{{ macos_wazuh_dir }}/etc/authd.pass"
owner: wazuh
group: wazuh
mode: 0640
when:
- wazuh_agent_config.enrollment.enabled == 'yes'
- wazuh_agent_config.enrollment.authorization_pass_path | length > 0
- authd_pass | length > 0
tags:
- config