diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a000be11..6696228ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file. ### Fixed +- Fix macOS agents provision to enable registration and connection with managers. ([#4770](https://github.com/wazuh/wazuh-qa/pull/4770/)) \- (Framework) - Fix hardcoded python interpreter in qa_framework role. ([#4658](https://github.com/wazuh/wazuh-qa/pull/4658)) \- (Framework) - Fix duplicated jq dependency ([#4678](https://github.com/wazuh/wazuh-qa/pull/4678)) \- (Framework) diff --git a/provisioning/playbooks/wazuh_environment.yaml b/provisioning/playbooks/wazuh_environment.yaml index 69270a0f36..49f56e44d3 100644 --- a/provisioning/playbooks/wazuh_environment.yaml +++ b/provisioning/playbooks/wazuh_environment.yaml @@ -53,19 +53,8 @@ username: wazuh password: wazuh -# Agent - hosts: agent - tasks: - - name: Agents - block: - - name: Install UNIX based agents - become: true - become_user: root - import_role: - name: "../roles/wazuh/ansible-wazuh-agent" - when: ansible_os_family != "Windows" - - - name: Install Windows based agents - import_role: - name: "../roles/wazuh/ansible-wazuh-agent" - when: ansible_os_family == "Windows" + roles: + - role: "../roles/wazuh/ansible-wazuh-agent" + become: "{{ ansible_os_family != 'Windows' }}" + become_user: root diff --git a/provisioning/roles/wazuh/ansible-wazuh-agent/handlers/main.yml b/provisioning/roles/wazuh/ansible-wazuh-agent/handlers/main.yml index 84f3ff4553..d54184f29a 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-agent/handlers/main.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-agent/handlers/main.yml @@ -4,3 +4,6 @@ - name: Windows | Restart Wazuh Agent win_service: name=WazuhSvc start_mode=auto state=restarted + +- name: macOS | Restart Wazuh Agent + command: /Library/Ossec/bin/wazuh-control restart diff --git a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/MacOS.yml b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/MacOS.yml index 7ad4242218..525ce8fc16 100644 --- a/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/MacOS.yml +++ b/provisioning/roles/wazuh/ansible-wazuh-agent/tasks/MacOS.yml @@ -14,7 +14,7 @@ owner: root group: wazuh mode: 0644 - notify: restart wazuh-agent + notify: macOS | Restart Wazuh Agent tags: - init - config @@ -33,7 +33,7 @@ owner: root group: wazuh mode: 0640 - notify: restart wazuh-agent + notify: macOS | Restart Wazuh Agent tags: - init - config