mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
38 lines
893 B
YAML
38 lines
893 B
YAML
|
---
|
||
|
|
||
|
- name: create an ACL
|
||
|
consul_acl:
|
||
|
host: "{{ acl_host }}"
|
||
|
mgmt_token: "{{ mgmt_token }}"
|
||
|
name: "{{ test_consul_acl_token_name }}"
|
||
|
register: created_acl
|
||
|
|
||
|
- name: remove the ACL
|
||
|
consul_acl:
|
||
|
host: "{{ acl_host }}"
|
||
|
mgmt_token: "{{ mgmt_token }}"
|
||
|
token: "{{ created_acl.token }}"
|
||
|
state: absent
|
||
|
register: removed_acl
|
||
|
|
||
|
# TODO: This does little to actually verify that the ACL has been removed
|
||
|
- name: verify ACL has been removed
|
||
|
assert:
|
||
|
that:
|
||
|
- removed_acl.changed
|
||
|
- removed_acl.operation == "remove"
|
||
|
- removed_acl.token | length == 36
|
||
|
|
||
|
- name: remove the ACL again
|
||
|
consul_acl:
|
||
|
host: "{{ acl_host }}"
|
||
|
mgmt_token: "{{ mgmt_token }}"
|
||
|
token: "{{ created_acl.token }}"
|
||
|
state: absent
|
||
|
register: doubly_removed_acl
|
||
|
|
||
|
- name: verify idempotence when deleting an ACL
|
||
|
assert:
|
||
|
that:
|
||
|
- not doubly_removed_acl.changed
|