mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
---
|
|
- name: setup
|
|
cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent
|
|
register: ag
|
|
- name: verify setup
|
|
assert:
|
|
that:
|
|
- ag|success
|
|
|
|
- name: test fail if missing name
|
|
action: cs_affinitygroup
|
|
register: ag
|
|
ignore_errors: true
|
|
- name: verify results of fail if missing name
|
|
assert:
|
|
that:
|
|
- ag|failed
|
|
- ag.msg == "missing required arguments: name"
|
|
|
|
- name: test present affinity group
|
|
cs_affinitygroup: name={{ cs_resource_prefix }}_ag
|
|
register: ag
|
|
- name: verify results of create affinity group
|
|
assert:
|
|
that:
|
|
- ag|success
|
|
- ag|changed
|
|
- ag.name == "{{ cs_resource_prefix }}_ag"
|
|
|
|
- name: test present affinity group is idempotence
|
|
cs_affinitygroup: name={{ cs_resource_prefix }}_ag
|
|
register: ag
|
|
- name: verify results present affinity group is idempotence
|
|
assert:
|
|
that:
|
|
- ag|success
|
|
- not ag|changed
|
|
- ag.name == "{{ cs_resource_prefix }}_ag"
|
|
|
|
- name: test absent affinity group
|
|
cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent
|
|
register: ag
|
|
- name: verify results of absent affinity group
|
|
assert:
|
|
that:
|
|
- ag|success
|
|
- ag|changed
|
|
- ag.name == "{{ cs_resource_prefix }}_ag"
|
|
|
|
- name: test absent affinity group is idempotence
|
|
cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent
|
|
register: ag
|
|
- name: verify results of absent affinity group is idempotence
|
|
assert:
|
|
that:
|
|
- ag|success
|
|
- not ag|changed
|
|
- ag.name is undefined
|