expand test_init to unseal and print
- assert: { that: "'keys' in vault_init" }
- assert: { that: "'root_token' in vault_init" }
- assert: { that: "{{vault_init.rc}} == 0" }
+ - set_fact:
+ vault_keys: "{{vault_init['keys'] | join(' ')}}"
+ - 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" }
+ - debug:
+ msg: export VAULT_TOKEN='{{vault_init['root_token']}}'
+ - debug:
+ msg: export VAULT_KEYS='{{vault_init['keys'] | join(' ')}}'
when: "vault_init.changed == True"
