ansible/test/legacy/roles/test_consul_acl/tasks/create-acl-without-rules.yml
Matt Clay 781fd7099a Reorganize integration tests:
- Move legacy tests into a separate directory.
- Reduce common dependencies between targets.
2017-09-14 07:14:30 -07:00

35 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