From f15ead77c624a5329efd5730ca7bf3f6f4741172 Mon Sep 17 00:00:00 2001 From: c-bordon Date: Thu, 27 Jun 2024 16:13:59 -0300 Subject: [PATCH] Fixed macOS validations --- .../wazuh/wazuh-indexer/tasks/local_actions.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/wazuh/wazuh-indexer/tasks/local_actions.yml b/roles/wazuh/wazuh-indexer/tasks/local_actions.yml index b3ad0714..ffff6c31 100644 --- a/roles/wazuh/wazuh-indexer/tasks/local_actions.yml +++ b/roles/wazuh/wazuh-indexer/tasks/local_actions.yml @@ -21,13 +21,13 @@ stat: path: "{{ local_certs_path }}/wazuh-certs-tool.sh" register: tool_package - when: ansible_os_family == 'Darwin' + when: ansible_os_family != 'Darwin' - name: Local action | Download certificates generation tool get_url: url: "{{ certs_gen_tool_url }}" dest: "{{ local_certs_path }}/wazuh-certs-tool.sh" - when: not (tool_package.stat.exists | default(1)) and ansible_os_family == 'Darwin' + when: not tool_package.stat.exists and ansible_os_family != 'Darwin' - name: Local action | Prepare the certificates generation template file template: @@ -35,23 +35,23 @@ dest: "{{ local_certs_path }}/config.yml" mode: 0644 register: tlsconfig_template - when: ansible_os_family == 'Darwin' + when: ansible_os_family != 'Darwin' - name: Local action | Generate the node & admin certificates in local command: >- bash {{ local_certs_path }}/wazuh-certs-tool.sh -A - when: ansible_os_family == 'Darwin' + when: ansible_os_family != 'Darwin' - name: Local action | Check for Docker installation on macOS command: docker --version register: docker_check - when: ansible_os_family != 'Darwin' + when: ansible_os_family == 'Darwin' ignore_errors: yes - name: Local action | Fail if Docker is not installed fail: msg: "Docker is not installed on this host." - when: (docker_check.rc | default(1)) != 0 and ansible_os_family != 'Darwin' + when: (docker_check.rc | default(1)) != 0 and ansible_os_family == 'Darwin' - name: Local action | Run Docker container on macOS community.docker.docker_container: @@ -62,13 +62,13 @@ volumes: - "{{ local_certs_path }}/config.yml:/config/certs.yml" - "{{ local_certs_path }}/wazuh-certificates:/certificates/" - when: ansible_os_family != 'Darwin' + when: ansible_os_family == 'Darwin' - name: Local action | Remove Docker image after execution community.docker.docker_image: name: "wazuh/wazuh-cert-tool" state: absent - when: ansible_os_family != 'Darwin' + when: ansible_os_family == 'Darwin' run_once: true delegate_to: localhost