Changed macOS validation to a variable
This commit is contained in:
parent
cdc4005ea1
commit
dbc6e6cd70
@ -43,6 +43,7 @@
|
|||||||
name: node-6
|
name: node-6
|
||||||
ip: "{{ hostvars.dashboard.private_ip }}"
|
ip: "{{ hostvars.dashboard.private_ip }}"
|
||||||
role: dashboard
|
role: dashboard
|
||||||
|
macos_localhost: false
|
||||||
tags:
|
tags:
|
||||||
- generate-certs
|
- generate-certs
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
name: node-1 # Important: must be equal to indexer_node_name.
|
name: node-1 # Important: must be equal to indexer_node_name.
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
role: indexer
|
role: indexer
|
||||||
|
macos_localhost: false
|
||||||
tags:
|
tags:
|
||||||
- generate-certs
|
- generate-certs
|
||||||
# Single node
|
# Single node
|
||||||
|
|||||||
@ -48,3 +48,6 @@ generate_certs: true
|
|||||||
perform_installation: true
|
perform_installation: true
|
||||||
|
|
||||||
indexer_nolog_sensible: true
|
indexer_nolog_sensible: true
|
||||||
|
|
||||||
|
# Docker image for certificates generation on macOS
|
||||||
|
wazuh_certs_tool_docker: "wazuh/wazuh-cert-tool:{{ indexer_version }}"
|
||||||
|
|||||||
@ -21,13 +21,12 @@
|
|||||||
stat:
|
stat:
|
||||||
path: "{{ local_certs_path }}/wazuh-certs-tool.sh"
|
path: "{{ local_certs_path }}/wazuh-certs-tool.sh"
|
||||||
register: tool_package
|
register: tool_package
|
||||||
when: ansible_os_family != 'Darwin'
|
|
||||||
|
|
||||||
- name: Local action | Download certificates generation tool
|
- name: Local action | Download certificates generation tool
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ certs_gen_tool_url }}"
|
url: "{{ certs_gen_tool_url }}"
|
||||||
dest: "{{ local_certs_path }}/wazuh-certs-tool.sh"
|
dest: "{{ local_certs_path }}/wazuh-certs-tool.sh"
|
||||||
when: not tool_package.stat.exists and ansible_os_family != 'Darwin'
|
when: not tool_package.stat.exists and not macos_localhost
|
||||||
|
|
||||||
- name: Local action | Prepare the certificates generation template file
|
- name: Local action | Prepare the certificates generation template file
|
||||||
template:
|
template:
|
||||||
@ -39,36 +38,36 @@
|
|||||||
- name: Local action | Generate the node & admin certificates in local
|
- name: Local action | Generate the node & admin certificates in local
|
||||||
command: >-
|
command: >-
|
||||||
bash {{ local_certs_path }}/wazuh-certs-tool.sh -A
|
bash {{ local_certs_path }}/wazuh-certs-tool.sh -A
|
||||||
when: ansible_os_family != 'Darwin'
|
when: not macos_localhost
|
||||||
|
|
||||||
- name: Local action | Check for Docker installation on macOS
|
- name: Local action | Check for Docker installation on macOS
|
||||||
command: docker --version
|
command: docker --version
|
||||||
register: docker_check
|
register: docker_check
|
||||||
when: ansible_os_family == 'Darwin'
|
when: macos_localhost
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Local action | Fail if Docker is not installed
|
- name: Local action | Fail if Docker is not installed
|
||||||
fail:
|
fail:
|
||||||
msg: "Docker is not installed on this host."
|
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 macos_localhost
|
||||||
|
|
||||||
- name: Local action | Run Docker container on macOS
|
- name: Local action | Run Docker container on macOS
|
||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
name: wazuh-cert-tool
|
name: wazuh-cert-tool
|
||||||
image: "wazuh/wazuh-cert-tool"
|
image: "{{ wazuh_certs_tool_docker }}"
|
||||||
state: started
|
state: started
|
||||||
auto_remove: true
|
auto_remove: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ local_certs_path }}/config.yml:/config/certs.yml"
|
- "{{ local_certs_path }}/config.yml:/config/certs.yml"
|
||||||
- "{{ local_certs_path }}/wazuh-certificates/:/certificates/"
|
- "{{ local_certs_path }}/wazuh-certificates/:/certificates/"
|
||||||
when: ansible_os_family == 'Darwin'
|
when: macos_localhost
|
||||||
|
|
||||||
- name: Local action | Remove Docker image after execution
|
- name: Local action | Remove Docker image after execution
|
||||||
community.docker.docker_image:
|
community.docker.docker_image:
|
||||||
name: "wazuh/wazuh-cert-tool"
|
name: "{{ wazuh_certs_tool_docker }}"
|
||||||
state: absent
|
state: absent
|
||||||
force_absent: yes
|
force_absent: yes
|
||||||
when: ansible_os_family == 'Darwin'
|
when: macos_localhost
|
||||||
|
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user