tune and disable should use secret_engine instead
gather_facts: no
tasks:
- name: Make sure kv2 secret store is disabled
- hashivault_secret_disable:
+ hashivault_secret_engine:
name: "kv2"
+ state: absent
failed_when: False
- name: Enable kv2 secret store
- assert: { that: "'{{vault_read.msg}}' == 'Secret secret/kv2/name is not in vault'" }
- name: Tune kv2 secret store
- hashivault_mount_tune:
- mount_point: kv2
+ hashivault_secret_engine:
+ backend: kv
+ name: kv2
+ options:
+ version: 2
+ config:
default_lease_ttl: 3600
max_lease_ttl: 8600
register: vault_tune
- assert: { that: "{{ vault_tune.rc }} == 0" }
- name: Idempotent tuning kv2 secret store
- hashivault_mount_tune:
- mount_point: kv2
+ hashivault_secret_engine:
+ backend: kv
+ name: kv2
+ options:
+ version: 2
+ config:
default_lease_ttl: 3600
max_lease_ttl: 8600
register: vault_tune
- assert: { that: "{{ vault_tune.rc }} == 0" }
- name: Disable kv2 secret store
- hashivault_secret_disable:
+ hashivault_secret_engine:
name: "kv2"
+ state: absent
register: 'vault_secret_disable'
- assert: { that: "{{vault_secret_enable.changed}} == True" }
- assert: { that: "{{vault_secret_enable.rc}} == 0" }
\ No newline at end of file
