mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
781fd7099a
- Move legacy tests into a separate directory. - Reduce common dependencies between targets.
41 lines
987 B
YAML
41 lines
987 B
YAML
---
|
|
|
|
- name: create an ACL with a given token
|
|
consul_acl:
|
|
host: "{{ acl_host }}"
|
|
mgmt_token: "{{ mgmt_token }}"
|
|
name: "{{ test_consul_acl_token_name }}"
|
|
token: "{{ test_consul_acl_token_id }}"
|
|
rules:
|
|
- key: "foo"
|
|
policy: write
|
|
register: created_acl
|
|
|
|
- name: verify ACL created with given token
|
|
assert:
|
|
that:
|
|
- created_acl.changed
|
|
- created_acl.operation == "create"
|
|
- created_acl.token == test_consul_acl_token_id
|
|
|
|
- name: re-create ACL with the token
|
|
consul_acl:
|
|
host: "{{ acl_host }}"
|
|
mgmt_token: "{{ mgmt_token }}"
|
|
token: "{{ test_consul_acl_token_id }}"
|
|
rules:
|
|
- key: "foo"
|
|
policy: write
|
|
register: doubly_created_acl
|
|
|
|
- name: verify idempotence when creating ACL with same token
|
|
assert:
|
|
that:
|
|
- not doubly_created_acl.changed
|
|
|
|
- name: clean up
|
|
consul_acl:
|
|
host: "{{ acl_host }}"
|
|
mgmt_token: "{{ mgmt_token }}"
|
|
token: "{{ created_acl.token }}"
|
|
state: absent
|