File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 3
3
gather_facts : false
4
4
vars :
5
5
wazuh_secrets_path : " {{ kayobe_env_config_path }}/wazuh-secrets.yml"
6
+ override_special_characters : ' "#$%&()*+,-./:;<=>?@[\]^_{|}~'
6
7
tasks :
7
8
- name : install passlib[bcrypt]
8
9
pip :
19
20
path : " {{ wazuh_secrets_path }}"
20
21
register : waz_exist_result
21
22
23
+ - name : Check if secret is encrypted
24
+ block :
25
+ - name : Try to decrypt secret
26
+ no_log : True
27
+ copy :
28
+ content : " {{ lookup('ansible.builtin.file', wazuh_secrets_path) | ansible.builtin.vault(ansible_vault_password) }}"
29
+ dest : " {{ wazuh_secrets_path }}"
30
+ decrypt : True
31
+ vars :
32
+ ansible_vault_password : " {{ lookup('ansible.builtin.env', 'KAYOBE_VAULT_PASSWORD') }}"
33
+ rescue :
34
+ - name : Secrets already decrypted
35
+ ansible.builtin.debug :
36
+ msg : ' Secret was already decrypted'
37
+ when : waz_exist_result.stat.exists
38
+
22
39
- name : Template new secrets
23
40
no_log : True
24
41
template :
34
51
decrypt : false
35
52
vars :
36
53
ansible_vault_password : " {{ lookup('ansible.builtin.env', 'KAYOBE_VAULT_PASSWORD') }}"
37
- when : not waz_exist_result.stat.exists
You can’t perform that action at this time.
0 commit comments