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.
188 lines
6.6 KiB
YAML
188 lines
6.6 KiB
YAML
10 years ago
|
---
|
||
9 years ago
|
- name: setup instance to be absent
|
||
|
cs_instance: name={{ cs_resource_prefix }}-vm-{{ instance_number }} state=absent
|
||
|
register: instance
|
||
|
- name: verify instance to be absent
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
|
||
10 years ago
|
- name: test create instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
template: "{{ test_cs_instance_template }}"
|
||
|
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
affinity_group: "{{ cs_resource_prefix }}-ag"
|
||
|
security_group: "{{ cs_resource_prefix }}-sg"
|
||
|
ssh_key: "{{ cs_resource_prefix }}-sshkey"
|
||
|
tags: []
|
||
|
register: instance
|
||
|
- name: verify create instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
- instance.ssh_key == "{{ cs_resource_prefix }}-sshkey"
|
||
|
- not instance.tags
|
||
|
|
||
|
- name: test create instance idempotence
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
template: "{{ test_cs_instance_template }}"
|
||
|
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
affinity_group: "{{ cs_resource_prefix }}-ag"
|
||
|
security_group: "{{ cs_resource_prefix }}-sg"
|
||
|
ssh_key: "{{ cs_resource_prefix }}-sshkey"
|
||
|
tags: []
|
||
|
register: instance
|
||
|
- name: verify create instance idempotence
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- not instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
- instance.ssh_key == "{{ cs_resource_prefix }}-sshkey"
|
||
|
- not instance.tags
|
||
|
|
||
|
- name: test running instance not updated
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
service_offering: "{{ test_cs_instance_offering_2 }}"
|
||
10 years ago
|
register: instance
|
||
|
- name: verify running instance not updated
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- not instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
|
||
|
- name: test stopping instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
state: stopped
|
||
|
register: instance
|
||
|
- name: verify stopping instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Stopped"
|
||
|
|
||
|
- name: test stopping instance idempotence
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
state: stopped
|
||
|
register: instance
|
||
|
- name: verify stopping instance idempotence
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- not instance|changed
|
||
|
- instance.state == "Stopped"
|
||
|
|
||
|
- name: test updating stopped instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
display_name: "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
9 years ago
|
service_offering: "{{ test_cs_instance_offering_2 }}"
|
||
10 years ago
|
register: instance
|
||
|
- name: verify updating stopped instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_2 }}"
|
||
10 years ago
|
- instance.state == "Stopped"
|
||
|
|
||
|
- name: test starting instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
state: started
|
||
|
register: instance
|
||
|
- name: verify starting instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_2 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
|
||
|
- name: test starting instance idempotence
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
state: started
|
||
|
register: instance
|
||
|
- name: verify starting instance idempotence
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- not instance|changed
|
||
9 years ago
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
|
- instance.service_offering == "{{ test_cs_instance_offering_2 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
|
||
|
- name: test force update running instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
force: true
|
||
|
register: instance
|
||
|
- name: verify force update running instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
|
|
||
|
- name: test force update running instance idempotence
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
force: true
|
||
|
register: instance
|
||
|
- name: verify force update running instance idempotence
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- not instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
9 years ago
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
9 years ago
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|
||
10 years ago
|
- instance.state == "Running"
|
||
9 years ago
|
|
||
|
- name: test restore instance
|
||
|
cs_instance:
|
||
|
name: "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
template: "{{ test_cs_instance_template }}"
|
||
|
state: restored
|
||
|
register: instance
|
||
|
- name: verify restore instance
|
||
|
assert:
|
||
|
that:
|
||
|
- instance|success
|
||
|
- instance|changed
|
||
|
- instance.name == "{{ cs_resource_prefix }}-vm-{{ instance_number }}"
|
||
|
- instance.display_name == "{{ cs_resource_prefix }}-display-{{ instance_number }}"
|
||
|
- instance.service_offering == "{{ test_cs_instance_offering_1 }}"
|