Skip to content

Commit

Permalink
Don't use nest jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
bendem authored Feb 5, 2024
1 parent 6a48fdd commit c553d30
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions functional/test_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
secret_threshold: 1
register: 'vault_init'
- block:
- assert: { that: "{{vault_init.rc}} == 0" }
when: "vault_init.changed == False"
- assert: { that: "vault_init.rc == 0" }
when: "vault_init is not changed"
- block:
- assert: { that: "'keys' in vault_init" }
- assert: { that: "'root_token' in vault_init" }
- assert: { that: "{{vault_init.rc}} == 0" }
- assert: { that: "vault_init.rc == 0" }
- set_fact:
vault_keys: "{{vault_init['keys'] | join(' ')}}"
- name: Unseal the vault
hashivault_unseal:
keys: '{{vault_keys}}'
register: 'vault_unseal'
- assert: { that: "{{vault_unseal.changed}} == True" }
- assert: { that: "{{vault_unseal.status.progress}} == 0" }
- assert: { that: "{{vault_unseal.status.sealed}} == False" }
- assert: { that: "{{vault_unseal.rc}} == 0" }
- assert: { that: "vault_unseal is changed" }
- assert: { that: "vault_unseal.status.progress == 0" }
- assert: { that: "vault_unseal.status.sealed == False" }
- assert: { that: "vault_unseal.rc == 0" }
- template:
src: "{{playbook_dir}}/templates/vaultenv.sh.j2"
dest: "{{playbook_dir}}/vaultenv.sh"
mode: 0700
when: "vault_init.changed == True"
when: "vault_init is changed"

0 comments on commit c553d30

Please sign in to comment.