Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wazuh Cluster only playbook #829

Closed
maumrsms opened this issue Aug 1, 2022 · 4 comments
Closed

Add Wazuh Cluster only playbook #829

maumrsms opened this issue Aug 1, 2022 · 4 comments

Comments

@maumrsms
Copy link
Member

maumrsms commented Aug 1, 2022

Hello team!

I recently needed to work on an Ansible playbook to deploy 1 Wazuh cluster composed by 1 master node + 2 worker nodes only. No indexer, no dashboard, no Filebeat.

This is the playbook:

---
# Wazuh cluster
    - hosts: manager
      roles:
        - role: "../roles/wazuh/ansible-wazuh-manager"
      become: yes
      become_user: root
      vars:
        wazuh_manager_config:
          connection:
              - type: 'secure'
                port: '1514'
                protocol: 'tcp'
                queue_size: 131072
          api:
              https: 'yes'
          cluster:
              disable: 'no'
              node_name: 'master'
              node_type: 'master'
              key: 'c98b62a9b6169ac5f67dae55ae4a9088'
              nodes:
                  - "{{ hostvars.manager.private_ip }}"
              hidden: 'no'
        wazuh_api_users:
          - username: custom-user
            password: SecretPassword1!

    - hosts: worker
      roles:
        - role: "../roles/wazuh/ansible-wazuh-manager"
      become: yes
      become_user: root
      vars:
        wazuh_manager_config:
          connection:
              - type: 'secure'
                port: '1514'
                protocol: 'tcp'
                queue_size: 131072
          api:
              https: 'yes'
          cluster:
              disable: 'no'
              node_name: 'worker_01'
              node_type: 'worker'
              key: 'c98b62a9b6169ac5f67dae55ae4a9088'
              nodes:
                  - "{{ hostvars.manager.private_ip }}"
              hidden: 'no'
                
    - hosts: worker02
      roles:
        - role: "../roles/wazuh/ansible-wazuh-manager"
      become: yes
      become_user: root
      vars:
        wazuh_manager_config:
          connection:
              - type: 'secure'
                port: '1514'
                protocol: 'tcp'
                queue_size: 131072
          api:
              https: 'yes'
          cluster:
              disable: 'no'
              node_name: 'worker_02'
              node_type: 'worker'
              key: 'c98b62a9b6169ac5f67dae55ae4a9088'
              nodes:
                  - "{{ hostvars.manager.private_ip }}"
              hidden: 'no'

It would be useful for users to have a similar cluster deployment option in Wazuh Ansible files.

@teddytpc1
Copy link
Member

Hi, @maumrsms is this really useful? Why would a user need to deploy Wazuh managers without the rest of the components?

@maumrsms
Copy link
Member Author

Hello @teddytpc1!
Simply because not everybody uses Indexer/Elasticsearch. In fact this was requested by a BIG company that deploys clusters in a frequent manner.
Still, you are the one who will confirm how feasible this is maintain.
Let me know any comment!

@teddytpc1 teddytpc1 self-assigned this Dec 29, 2022
@teddytpc1
Copy link
Member

Alright, it makes sense. We will provide a new playbook for this case.
Thanks!

@teddytpc1
Copy link
Member

The playbook was added and tested with three nodes:

  • 2 RedHat 9 nodes
  • 1 Ubuntu 20.04

The tests finished without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants