Skip to content

Commit 65029a2

Browse files
committed
Generate Wazuh password and encrypt the file at the end.
1 parent 0276fc9 commit 65029a2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

etc/kayobe/ansible/wazuh-secrets.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@
2626
wazuh_password: "{{ random_password.stdout }}"
2727

2828
- name: Template new secrets
29+
no_log: True
2930
template:
3031
src: wazuh-secrets.yml.j2
3132
dest: "{{ wazuh_secrets_path }}"
32-
notify: Please encrypt keys
3333

34-
handlers:
35-
- name: Please encrypt keys
36-
debug:
37-
msg: >-
38-
Please encrypt the keys using Ansible Vault.
34+
- name: In-place encrypt wazuh-secrets
35+
copy:
36+
content: "{{ lookup('ansible.builtin.file', wazuh_secrets_path) | ansible.builtin.vault(ansible_vault_password) }}"
37+
dest: "{{ wazuh_secrets_path }}"
38+
decrypt: false
39+
vars:
40+
ansible_vault_password: "{{ lookup('ansible.builtin.env', 'KAYOBE_VAULT_PASSWORD') }}"
41+

0 commit comments

Comments
 (0)