-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
.github/workflows/ansible-playbooks/distributed_generate_certificates.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
- hosts: localhost | ||
become: true | ||
|
||
vars: | ||
test_name: "{{ test_name }}" | ||
test_dir: "/{{ test_name }}" | ||
logs_path: "{{ log_folder }}" | ||
tmp_path: "{{ tmp_path }}" | ||
pkg_repository: "{{ pkg_repository }}" | ||
|
||
tasks: | ||
- name: Create log directory | ||
file: | ||
path: "{{ test_dir }}" | ||
state: directory | ||
|
||
- name: Create log file | ||
file: | ||
dest: "{{ test_dir }}/{{ test_name }}.log" | ||
state: touch | ||
|
||
- name: Create certificates | ||
block: | ||
- name: Rendering wazuh-config file | ||
template: | ||
src: "{{ tmp_path }}/.github/workflows/templates/config.j2" | ||
dest: "{{ tmp_path }}/config.yml" | ||
mode: "664" | ||
force: yes | ||
when: split is not defined | ||
|
||
- name: See config.yml content | ||
shell: "cat {{ tmp_path }}/config.yml" | ||
|
||
- name: Creating wazuh-install.sh script | ||
shell: "bash {{ tmp_path }}/builder.sh -i -d {{ pkg_repository }}" | ||
|
||
- name: Creating Certificates | ||
shell: "bash {{ tmp_path }}/wazuh-install.sh -g -v" | ||
register: certificates_install | ||
|
||
- name: Give read permissions to wazuh-install-files.tar | ||
shell: "chmod +r {{ tmp_path }}/wazuh-install-files.tar" | ||
|
||
always: | ||
- name: Save output certificate build and creation | ||
blockinfile: | ||
marker: "" | ||
path: "{{ test_dir }}/{{ test_name }}.log" | ||
block: | | ||
{{ certificates_install.stderr }} | ||
-------------------------------- | ||
{{ certificates_install.stdout }} | ||
- name: Fetch log | ||
fetch: | ||
src: "{{ test_dir }}/{{ test_name }}.log" | ||
dest: "{{ logs_path }}/" | ||
flat: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
nodes: | ||
# Wazuh indexer nodes | ||
indexer: | ||
{% for indexer in groups['indexers'] %} | ||
- name: {{ hostvars[indexer]['inventory_hostname'] }} | ||
ip: "{{ hostvars[indexer]['private_ip'] }}" | ||
{% endfor %} | ||
server: | ||
{% for manager in groups['managers'] %} | ||
- name: {{ hostvars[manager]['inventory_hostname'] }} | ||
ip: "{{ hostvars[manager]['private_ip'] }}" | ||
node_type: "{{ hostvars[manager]['manager_type'] }}" | ||
{% endfor %} | ||
dashboard: | ||
{% for dashboard in groups['dashboards'] %} | ||
- name: {{ hostvars[dashboard]['inventory_hostname'] }} | ||
ip: "{{ hostvars[dashboard]['private_ip'] }}" | ||
{% endfor %} |