Skip to content

Commit

Permalink
commit all my PR fixes to one branch
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzk committed Jun 5, 2023
1 parent d5e9291 commit 9c3f04a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a sing
```yaml
---
# Certificates generation
- hosts: aio
- hosts: wazuh_aio
roles:
- role: ../roles/wazuh/wazuh-indexer
perform_installation: false
Expand All @@ -356,7 +356,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a sing
tags:
- generate-certs
# Single node
- hosts: aio
- hosts: wazuh_aio
become: yes
become_user: root
roles:
Expand All @@ -383,7 +383,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a sing
### Inventory file

```ini
[aio]
[wazuh_aio]
<your server host>
[all:vars]
Expand Down
7 changes: 4 additions & 3 deletions playbooks/wazuh-agent.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
- hosts: <your wazuh agents hosts>
- hosts: wazuh_clients:!wazuh_aio
become: yes
become_user: root
roles:
- ../roles/wazuh/ansible-wazuh-agent
vars:
wazuh_managers:
- address: <your manager IP>
- address: wazuh_aio
port: 1514
protocol: tcp
api_port: 55000
api_proto: 'http'
api_user: ansible
max_retries: 5
retry_interval: 5
retry_interval: 5

4 changes: 2 additions & 2 deletions playbooks/wazuh-single.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Certificates generation
- hosts: aio
- hosts: wazuh_aio
roles:
- role: ../roles/wazuh/wazuh-indexer
perform_installation: false
Expand All @@ -16,7 +16,7 @@
tags:
- generate-certs
# Single node
- hosts: aio
- hosts: wazuh_aio
become: yes
become_user: root
roles:
Expand Down
2 changes: 2 additions & 0 deletions roles/wazuh/wazuh-indexer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
tags: debug
when:
- hostvars[inventory_hostname]['private_ip'] is not defined or not hostvars[inventory_hostname]['private_ip']
- not ansible_check_mode

- name: Wait for Wazuh indexer API (Private IP)
uri:
Expand All @@ -128,6 +129,7 @@
tags: debug
when:
- hostvars[inventory_hostname]['private_ip'] is defined and hostvars[inventory_hostname]['private_ip']
- not ansible_check_mode

- import_tasks: "RMRedHat.yml"
when: ansible_os_family == "RedHat"
Expand Down
8 changes: 6 additions & 2 deletions roles/wazuh/wazuh-indexer/tasks/security_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
replace: "{{ indexer_password_hash | quote }}"
vars:
indexer_password_hash: "{{ indexer_admin_password_hashed.stdout_lines | last }}"

when:
- not ansible_check_mode

# this can also be achieved with password_hash, but it requires dependencies on the controller
- name: Hash the kibanaserver role/user pasword
shell: |
Expand All @@ -76,7 +78,9 @@
replace: "{{ indexer_password_hash | quote }}"
vars:
indexer_password_hash: "{{ indexer_kibanaserver_password_hashed.stdout_lines | last }}"

when:
- not ansible_check_mode

- name: Initialize the Opensearch security index in Wazuh indexer
command: >
sudo -u wazuh-indexer OPENSEARCH_PATH_CONF={{ indexer_conf_path }}
Expand Down

0 comments on commit 9c3f04a

Please sign in to comment.