Added auto enrollment alternative to macOS.yml
This commit is contained in:
parent
61c40a1fec
commit
07d4228fa4
@ -206,6 +206,16 @@
|
||||
- config
|
||||
- api
|
||||
|
||||
- name: macOS | Agent registration via auto-enrollment
|
||||
debug:
|
||||
msg: Agent registration will be performed through enrollment option in templated ossec.conf
|
||||
when: wazuh_agent_config.enrollment.enabled == 'yes'
|
||||
|
||||
- name: macOS | Ensure group "wazuh" exists
|
||||
ansible.builtin.group:
|
||||
name: wazuh
|
||||
state: present
|
||||
|
||||
- name: macOS | Installing agent configuration (ossec.conf)
|
||||
template:
|
||||
src: var-ossec-etc-ossec-agent.conf.j2
|
||||
@ -230,6 +240,20 @@
|
||||
- init
|
||||
- config
|
||||
|
||||
- name: Create auto-enrollment password file
|
||||
template:
|
||||
src: authd_pass.j2
|
||||
dest: "{{ wazuh_macos_config.install_dir }}/etc/authd.pass"
|
||||
owner: wazuh
|
||||
group: wazuh
|
||||
mode: 0640
|
||||
when:
|
||||
- wazuh_agent_config.enrollment.enabled == 'yes'
|
||||
- wazuh_agent_config.enrollment.authorization_pass_path_macos | length > 0
|
||||
- authd_pass | length > 0
|
||||
tags:
|
||||
- config
|
||||
|
||||
- name: macOS | Delete downloaded Wazuh agent installer file
|
||||
file:
|
||||
path: "{{ wazuh_macos_config.download_dir }}{{ wazuh_macos_package_name }}"
|
||||
|
||||
@ -67,8 +67,10 @@
|
||||
{% if wazuh_agent_config.enrollment.agent_key_path | length > 0 %}
|
||||
<agent_key_path>{{ wazuh_agent_config.enrollment.agent_key_path }}</agent_key_path>
|
||||
{% endif %}
|
||||
{% if wazuh_agent_config.enrollment.authorization_pass_path | length > 0 %}
|
||||
{% if wazuh_agent_config.enrollment.authorization_pass_path | length > 0 and ansible_system != "Darwin" %}
|
||||
<authorization_pass_path>{{ wazuh_agent_config.enrollment.authorization_pass_path }}</authorization_pass_path>
|
||||
{% else %}
|
||||
<authorization_pass_path>{{ wazuh_agent_config.enrollment.authorization_pass_path_macos }}</authorization_pass_path>
|
||||
{% endif %}
|
||||
{% if wazuh_agent_config.enrollment.auto_method | length > 0 %}
|
||||
<auto_method>{{ wazuh_agent_config.enrollment.auto_method }}</auto_method>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user