version should be int
name: "kv2"
backend: "kv"
options:
- version: "2"
+ version: 2
register: 'vault_secret_enable'
- assert: { that: "{{vault_secret_enable.changed}} == True" }
- assert: { that: "{{vault_secret_enable.rc}} == 0" }
name: "kv2"
backend: "kv"
options:
- version: "2"
+ version: 2
register: 'vault_secret_enable_twice'
- assert: { that: "{{vault_secret_enable_twice.changed}} == False" }
- assert: { that: "{{vault_secret_enable_twice.rc}} == 0" }
- name: Write a value to the kv2 store
hashivault_write:
secret: '/kv2/name'
- version: "2"
+ version: 2
data:
value: 'kv2_stuff'
hashivault_read:
secret: '/kv2/name'
key: 'value'
- version: "2"
+ version: 2
register: 'vault_read'
- assert: { that: "'{{vault_read.value}}' == 'kv2_stuff'" }
- name: Delete kv2 secret
hashivault_delete:
secret: '/kv2/name'
- version: "2"
+ version: 2
register: 'vault_secret_eph_delete'
- assert: { that: "{{vault_secret_eph_delete.changed}} == True" }
- assert: { that: "{{vault_secret_eph_delete.rc}} == 0" }
- name: Make sure kv2 value is gone
hashivault_read:
secret: '/kv2/name'
- version: "2"
+ version: 2
register: 'vault_read'
failed_when: False
- assert: { that: "{{vault_read.changed}} == False" }
