-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
356 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cloud/cs | ||
cs/group2 | ||
cs/group4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
cs_template_hypervisor: Simulator | ||
cs_template_os_type: Other Linux (64-bit) | ||
cs_template_url: http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-vmware.ova | ||
cs_template_format: OVA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- cs_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- import_tasks: test1.yml | ||
- import_tasks: test2.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
--- | ||
- name: setup template | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
cross_zones: true | ||
state: absent | ||
register: template | ||
- name: verify setup template | ||
assert: | ||
that: | ||
- template is successful | ||
|
||
- name: test download template in check mode | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: true | ||
register: template | ||
check_mode: true | ||
- name: verify test download template in check mode | ||
assert: | ||
that: | ||
- template is changed | ||
|
||
- name: test download template | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: true | ||
register: template | ||
- name: verify test download template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == "ansible-template-test1" | ||
- template.cross_zones == true | ||
|
||
- name: test download template idempotence | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: true | ||
register: template | ||
- name: verify test download template idempotence | ||
assert: | ||
that: | ||
- template is not changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == "ansible-template-test1" | ||
- template.cross_zones == true | ||
|
||
- name: test update template in check mode | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
display_text: "{{ cs_resource_prefix }}-template display_text" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
is_featured: true | ||
cross_zones: true | ||
register: template | ||
check_mode: true | ||
- name: verify test update template in check mode | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == "ansible-template-test1" | ||
- template.cross_zones == true | ||
- template.is_featured == false | ||
|
||
- name: test update template | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
display_text: "{{ cs_resource_prefix }}-template display_text" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
is_featured: true | ||
cross_zones: true | ||
register: template | ||
- name: verify test update template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == cs_resource_prefix + "-template display_text" | ||
- template.cross_zones == true | ||
- template.is_featured == true | ||
|
||
- name: test update template idempotence | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
display_text: "{{ cs_resource_prefix }}-template display_text" | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
is_featured: true | ||
cross_zones: true | ||
register: template | ||
- name: verify test update template idempotence | ||
assert: | ||
that: | ||
- template is not changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == cs_resource_prefix + "-template display_text" | ||
- template.cross_zones == true | ||
- template.is_featured == true | ||
|
||
- name: test remove template in check mode | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
state: absent | ||
cross_zones: true | ||
register: template | ||
check_mode: true | ||
- name: verify test remove template in check mode | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == cs_resource_prefix + "-template display_text" | ||
- template.cross_zones == true | ||
|
||
- name: test remove template | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
state: absent | ||
cross_zones: true | ||
register: template | ||
- name: verify test remove template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test1" | ||
- template.display_text == cs_resource_prefix + "-template display_text" | ||
- template.cross_zones == true | ||
|
||
- name: test remove template idempotence | ||
ngine_io.cloudstack.template: | ||
name: "ansible-template-test1" | ||
state: absent | ||
cross_zones: true | ||
register: template | ||
- name: verify test remove template idempotence | ||
assert: | ||
that: | ||
- template is not changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
--- | ||
- name: setup template first template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: first template | ||
state: absent | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify setup template first template | ||
assert: | ||
that: | ||
- template is successful | ||
|
||
- name: setup template second template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
state: absent | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify setup template second template | ||
assert: | ||
that: | ||
- template is successful | ||
|
||
- name: test register first template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: first template | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template_first | ||
- name: verify test register first template | ||
assert: | ||
that: | ||
- template_first is changed | ||
- template_first.name == "ansible-template-test2" | ||
- template_first.display_text == "first template" | ||
- template_first.cross_zones == true | ||
|
||
- name: test register second template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template_second | ||
- name: verify test register second template | ||
assert: | ||
that: | ||
- template_second is changed | ||
- template_second.name == "ansible-template-test2" | ||
- template_second.display_text == "second template" | ||
- template_second.cross_zones == true | ||
- template_second.id != template_first.id | ||
|
||
- name: test multiple template same name absent without find options | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
state: absent | ||
cross_zones: yes | ||
register: template | ||
ignore_errors: yes | ||
- name: verify test multiple template same name absent without find options | ||
assert: | ||
that: | ||
- template is failed | ||
- template.msg.startswith('Multiple templates found') | ||
|
||
- name: test update second template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
is_featured: yes | ||
is_public: yes | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify test update second template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test2" | ||
- template.display_text == "second template" | ||
- template.cross_zones == true | ||
- template.id == template_second.id | ||
- template.is_featured == true | ||
- template.is_public == true | ||
|
||
- name: test update second template idempotence | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
is_featured: yes | ||
is_public: yes | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify test update second template idempotence | ||
assert: | ||
that: | ||
- template is not changed | ||
- template.name == "ansible-template-test2" | ||
- template.display_text == "second template" | ||
- template.cross_zones == true | ||
- template.id == template_second.id | ||
- template.is_featured == true | ||
|
||
- name: test update second template idempotence 2 | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
url: "{{ cs_template_url }}" | ||
format: "{{ cs_template_format }}" | ||
hypervisor: "{{ cs_template_hypervisor }}" | ||
os_type: "{{ cs_template_os_type }}" | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify test update second template idempotence | ||
assert: | ||
that: | ||
- template is not changed | ||
- template.name == "ansible-template-test2" | ||
- template.display_text == "second template" | ||
- template.cross_zones == true | ||
- template.id == template_second.id | ||
|
||
- name: test delete first template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: first template | ||
state: absent | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify test delete first template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test2" | ||
- template.display_text == "first template" | ||
- template.cross_zones == true | ||
- template.id == template_first.id | ||
- template.is_featured == false | ||
|
||
- name: test delete second template | ||
ngine_io.cloudstack.template: | ||
name: ansible-template-test2 | ||
display_text: second template | ||
state: absent | ||
cross_zones: yes | ||
template_find_options: display_text | ||
register: template | ||
- name: verify test delete second template | ||
assert: | ||
that: | ||
- template is changed | ||
- template.name == "ansible-template-test2" | ||
- template.display_text == "second template" | ||
- template.cross_zones == true | ||
- template.id == template_second.id | ||
- template.is_featured == true |