Hello Max,
1. First, update your /etc/ansible/hosts file to include both dashboard nodes:
[wi_cluster]
wi1 ansible_host=<WI1_IP> private_ip=<WI1_IP>
wi2 ansible_host=<WI2_IP> private_ip=<WI2_IP>
wi3 ansible_host=<WI3_IP> private_ip=<WI3_IP>
[manager]
manager ansible_host=<MANAGER_IP> private_ip=<MANAGER_IP>
[worker]
worker ansible_host=<WORKER_IP> private_ip=<WORKER_IP>
[dashboard]
dashboard1 ansible_host=<DASHBOARD1_IP> private_ip=<DASHBOARD1_IP>
dashboard2 ansible_host=<DASHBOARD2_IP> private_ip=<DASHBOARD2_IP>
[wi1]
wi1 ansible_host=<WI1_IP> private_ip=<WI1_IP>
2. Modify the playbook to include the new dashboard node in the certificate generation and the node itself. Here is a reduced version, so that you can have it as a reference:
---
# Certificates generation
- hosts: wi1
roles:
- role: ../roles/wazuh/wazuh-indexer
indexer_network_host: "{{ private_ip }}"
indexer_cluster_nodes:
- "{{ hostvars.wi1.private_ip }}"
- "{{ hostvars.wi2.private_ip }}"
- "{{ hostvars.wi3.private_ip }}"
indexer_discovery_nodes:
- "{{ hostvars.wi1.private_ip }}"
- "{{ hostvars.wi2.private_ip }}"
- "{{ hostvars.wi3.private_ip }}"
perform_installation: false
become: no
vars:
indexer_node_master: true
instances:
node1:
....
node6:
name: node-6
ip: "{{ hostvars.dashboard1.private_ip }}" # dashboard -> dashboard1
role: dashboard
node7: # Second dashboard
name: node-7
ip: "{{ hostvars.dashboard2.private_ip }}"
role: dashboard
tags:
- generate-certs
....
# Wazuh dashboard nodes
- hosts: dashboard
roles:
- role: "../roles/wazuh/wazuh-dashboard"
become: yes
become_user: root
vars:
indexer_network_host: "{{ hostvars.wi1.private_ip }}"
indexer_cluster_nodes:
- "{{ hostvars.wi1.private_ip }}"
- "{{ hostvars.wi2.private_ip }}"
- "{{ hostvars.wi3.private_ip }}"
dashboard_node_name: "{{ inventory_hostname }}" # Will use dashboard1/dashboard2 automatically
wazuh_api_credentials:
- id: default
url: https://{{ hostvars.manager.private_ip }}
port: 55000
username: custom-user
password: SecretPassword1!
ansible_shell_allow_world_readable_temp: true
3. Finally, you can run the playbook
ansible-playbook wazuh-production-ready.yml -b -K
I hope this helped,
Let me know if you need anything else.