forked from TerryHowe/ansible-modules-hashivault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_delete_permanent.yml
30 lines (27 loc) · 945 Bytes
/
test_delete_permanent.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- hosts: localhost
gather_facts: no
tasks:
- hashivault_write:
secret: test_delete_permanent
data:
uno: 'beck'
duo: 'clash'
- name: Make sure we can read it
hashivault_read:
secret: test_delete_permanent
- name: Delete secret
hashivault_delete:
secret: test_delete_permanent
permanent: true
register: vault_delete
- assert: { that: "{{vault_delete.changed}} == True" }
- assert: { that: "{{vault_delete.rc}} == 0" }
- assert: { that: "'{{vault_delete.msg}}' == 'Secret secret/test_delete_permanent deleted'" }
- name: Make sure secret value is gone
hashivault_read:
secret: test_delete_permanent
register: vault_read
failed_when: False
- assert: { that: "{{vault_read.changed}} == False" }
- assert: { that: "'{{vault_read.msg}}' == 'Secret secret/test_delete_permanent is not in vault'" }