You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/legacy/roles/test_consul_acl/tasks/remove-acl.yml

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