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/create-acl-without-rules.yml

36 lines
930 B
YAML

---
- name: create a new ACL without rules
consul_acl:
host: "{{ acl_host }}"
mgmt_token: "{{ mgmt_token }}"
name: "{{ test_consul_acl_token_name }}"
register: created_ruleless_acl
- name: verify ACL created without rules
assert:
that:
- created_ruleless_acl.changed
- created_ruleless_acl.operation == "create"
- created_ruleless_acl.token | length == 36
- created_ruleless_acl.rules == {}
- name: create same rule-less ACL
consul_acl:
host: "{{ acl_host }}"
mgmt_token: "{{ mgmt_token }}"
name: "{{ test_consul_acl_token_name }}"
register: doubly_created_ruleless_acl
- name: verify idempotence when creating ruleless ACL tokens
assert:
that:
- not doubly_created_ruleless_acl.changed
- name: clean up
consul_acl:
host: "{{ acl_host }}"
mgmt_token: "{{ mgmt_token }}"
token: "{{ doubly_created_ruleless_acl.token }}"
state: absent