-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
4 changed files
with
85 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cloud/cs | ||
cs/group1 | ||
cs/group3 | ||
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,3 @@ | ||
cloud/cs | ||
cs/group1 | ||
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,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,79 @@ | ||
--- | ||
- name: setup | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
state: absent | ||
|
||
- name: test fail if missing name | ||
ngine_io.cloudstack.instance_group: | ||
register: ig | ||
ignore_errors: true | ||
- name: verify results of fail if missing name | ||
assert: | ||
that: | ||
- ig is failed | ||
- "ig.msg == 'missing required arguments: name'" | ||
|
||
- name: test present instance group in check mode | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
register: ig | ||
check_mode: true | ||
- name: verify results of create instance group in check mode | ||
assert: | ||
that: | ||
- ig is changed | ||
|
||
- name: test present instance group | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
register: ig | ||
- name: verify results of create instance group | ||
assert: | ||
that: | ||
- ig is changed | ||
- ig.name == cs_resource_prefix + "_ig" | ||
|
||
- name: test present instance group is idempotence | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
register: ig | ||
- name: verify results present instance group is idempotence | ||
assert: | ||
that: | ||
- ig is not changed | ||
- ig.name == cs_resource_prefix + "_ig" | ||
|
||
- name: test absent instance group in check mode | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
state: absent | ||
register: ig | ||
check_mode: true | ||
- name: verify results of absent instance group in check mode | ||
assert: | ||
that: | ||
- ig is changed | ||
- ig.name == cs_resource_prefix + "_ig" | ||
|
||
- name: test absent instance group | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
state: absent | ||
register: ig | ||
- name: verify results of absent instance group | ||
assert: | ||
that: | ||
- ig is changed | ||
- ig.name == cs_resource_prefix + "_ig" | ||
|
||
- name: test absent instance group is idempotence | ||
ngine_io.cloudstack.instance_group: | ||
name: "{{ cs_resource_prefix }}_ig" | ||
state: absent | ||
register: ig | ||
- name: verify results of absent instance group is idempotence | ||
assert: | ||
that: | ||
- ig is not changed | ||
- ig.name is undefined |