ansible/test/integration/roles/test_cs_affinitygroup/tasks/main.yml

59 lines
1.4 KiB
YAML
Raw Normal View History

2015-05-03 14:06:30 +00:00
---
- 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'"
2015-05-03 14:06:30 +00:00
- 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