ansible/test/integration/targets/cs_instance/tasks/absent.yml
René Moser d5b04aa1f1 cloudstack: add check mode tests (#24908)
* cloudstack: test: cs_network_acl: add check_mode tests

* cloudstack: test: cs_pod: add check_mode tests

* cloudstack: test: cs_user: add check_mode tests

* cloudstack: test: cs_sshkeypair: add check_mode tests

* cloudstack: test: cs_project: add check_mode tests

* cloudstack: test: cs_vpc: add check_mode tests

* cloudstack: test: cs_vpn_gateway: add check_mode tests

* cloudstack: test: cs_volume: add check_mode tests

* cloudstack: test: cs_vmsnapshot: add check_mode tests

* cloudstack: test: cs_account: add check_mode tests

* cloudstack: test: cs_affinitygroup: add check_mode tests

* cloudstack: test: cs_cluster: add check_mode tests

* cloudstack: test: cs_domain: add check_mode tests

* cloudstack: test: cs_instancegroup: add check_mode tests

* cloudstack: test: cs_iso: add check_mode tests

* cloudstack: test: cs_loadbalancer_rule: add check_mode tests

* cloudstack: test: cs_portforward: add check_mode tests

* cloudstack: test: cs_resourcelimit: add check_mode tests

* cloudstack: test: cs_securitygroup: add check_mode tests

* cloudstack: test: cs_securitygroup_rule: add check_mode tests

* cloudstack: test: cs_configuration: add check_mode tests

* cloudstack: test: cs_firewall: add check_mode tests

* cloudstack: test: cs_instance: add check_mode tests

* cloudstack: query current tags from API

Fixes unexpected tags returned in check mode.
2017-05-26 12:19:47 +02:00

115 lines
3.3 KiB
YAML

---
- name: test destroy instance in check mode
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: absent
register: instance
check_mode: true
- name: verify destroy instance in check mode
assert:
that:
- instance|success
- instance|changed
- instance.state != "Destroyed"
- name: test destroy instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: absent
register: instance
- name: verify destroy instance
assert:
that:
- instance|success
- instance|changed
- instance.state == "Destroyed"
- name: test destroy instance idempotence
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: absent
register: instance
- name: verify destroy instance idempotence
assert:
that:
- instance|success
- not instance|changed
- name: test recover to stopped state and update a deleted instance in check mode
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: "{{ test_cs_instance_offering_1 }}"
state: stopped
register: instance
check_mode: true
- name: verify test recover to stopped state and update a deleted instance in check mode
assert:
that:
- instance|success
- instance|changed
- name: test recover to stopped state and update a deleted instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: "{{ test_cs_instance_offering_1 }}"
state: stopped
register: instance
- name: verify test recover to stopped state and update a deleted instance
assert:
that:
- instance|success
- instance|changed
- instance.state == "Stopped"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- name: test recover to stopped state and update a deleted instance idempotence
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
service_offering: "{{ test_cs_instance_offering_1 }}"
state: stopped
register: instance
- name: verify test recover to stopped state and update a deleted instance idempotence
assert:
that:
- instance|success
- not instance|changed
- instance.state == "Stopped"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- name: test expunge instance in check mode
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: expunged
register: instance
check_mode: true
- name: verify test expunge instance in check mode
assert:
that:
- instance|success
- instance|changed
- instance.state == "Stopped"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- name: test expunge instance
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: expunged
register: instance
- name: verify test expunge instance
assert:
that:
- instance|success
- instance|changed
- instance.state == "Stopped"
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
- name: test expunge instance idempotence
cs_instance:
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
state: expunged
register: instance
- name: verify test expunge instance idempotence
assert:
that:
- instance|success
- not instance|changed