mirror of https://github.com/ansible/ansible.git
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.
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
10 years ago
|
---
|
||
|
- 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
|
||
9 years ago
|
- "ag.msg == 'missing required arguments: name'"
|
||
10 years ago
|
|
||
|
- 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
|