ansible/test/integration/roles/test_cs_affinitygroup/tasks/main.yml
2015-08-19 21:39:58 +02:00

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