mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
automated integration tests for cloudstack (#20552)
This commit is contained in:
parent
b58cf0d23a
commit
aaf4f04574
92 changed files with 1248 additions and 193 deletions
|
|
@ -242,11 +242,6 @@ rackspace: $(CREDENTIALS_FILE)
|
|||
CLOUD_RESOURCE_PREFIX="$(CLOUD_RESOURCE_PREFIX)" make rackspace_cleanup ; \
|
||||
exit $$RC;
|
||||
|
||||
cloudstack:
|
||||
ansible-playbook cloudstack.yml -i $(INVENTORY) -e @$(VARS_FILE) -e "resource_prefix=$(CLOUD_RESOURCE_PREFIX)" -v $(TEST_FLAGS) ; \
|
||||
RC=$$? ; \
|
||||
exit $$RC;
|
||||
|
||||
exoscale:
|
||||
ansible-playbook exoscale.yml -i $(INVENTORY) -e @$(VARS_FILE) -v $(TEST_FLAGS) ; \
|
||||
RC=$$? ; \
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
connection: local
|
||||
gather_facts: no
|
||||
tags:
|
||||
- cloudstack
|
||||
vars:
|
||||
cs_resource_prefix: "{{ resource_prefix | default('cs-') }}"
|
||||
roles:
|
||||
- { role: test_cs_user, tags: test_cs_user }
|
||||
- { role: test_cs_project, tags: test_cs_project }
|
||||
- { role: test_cs_iso, tags: test_cs_iso }
|
||||
- { role: test_cs_domain, tags: test_cs_domain }
|
||||
- { role: test_cs_vmsnapshot, tags: test_cs_vmsnapshot }
|
||||
- { role: test_cs_sshkeypair, tags: test_cs_sshkeypair }
|
||||
- { role: test_cs_affinitygroup, tags: test_cs_affinitygroup }
|
||||
- { role: test_cs_securitygroup, tags: test_cs_securitygroup }
|
||||
- { role: test_cs_securitygroup_rule, tags: test_cs_securitygroup_rule }
|
||||
- { role: test_cs_instance, tags: test_cs_instance }
|
||||
- { role: test_cs_instancegroup, tags: test_cs_instancegroup }
|
||||
- { role: test_cs_portforward, tags: test_cs_portforward }
|
||||
- { role: test_cs_account, tags: test_cs_account }
|
||||
- { role: test_cs_firewall, tags: test_cs_firewall }
|
||||
- { role: test_cs_loadbalancer_rule, tags: test_cs_loadbalancer_rule }
|
||||
- { role: test_cs_volume, tags: test_cs_volume }
|
||||
- { role: test_cs_instance_facts, tags: test_cs_instance_facts }
|
||||
- { role: test_cs_configuration, tags: test_cs_configuration }
|
||||
- { role: test_cs_pod, tags: test_cs_pod }
|
||||
- { role: test_cs_cluster, tags: test_cs_cluster }
|
||||
- { role: test_cs_resourcelimit, tags: test_cs_resourcelimit }
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
cs_resource_prefix: cloudstack
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
test_cs_configuration_storage: PS0
|
||||
test_cs_configuration_cluster: C0
|
||||
test_cs_configuration_account: admin
|
||||
test_cs_configuration_zone: Sandbox-simulator
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
test_cs_lb_public_ip: "1.2.3.4"
|
||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
test_cs_lb_member: "{{ cs_resource_prefix }}_member1"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
cs_portforward_public_ip: "10.100.212.5"
|
||||
cs_portforward_vm: "{{ cs_resource_prefix }}-vm"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
last_name: "{{ cs_resource_prefix }}_last_name"
|
||||
first_name: "{{ cs_resource_prefix }}_first_name"
|
||||
email: "{{ cs_resource_prefix }}@example.com"
|
||||
network_domain: "{{ cs_resource_prefix }}.local"
|
||||
network_domain: "example.com"
|
||||
register: acc
|
||||
- name: verify results of create account
|
||||
assert:
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
last_name: "{{ cs_resource_prefix }}_last_name"
|
||||
first_name: "{{ cs_resource_prefix }}_first_name"
|
||||
email: "{{ cs_resource_prefix }}@example.com"
|
||||
network_domain: "{{ cs_resource_prefix }}.local"
|
||||
network_domain: "example.com"
|
||||
register: acc
|
||||
- name: verify results of create account idempotence
|
||||
assert:
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
- acc|success
|
||||
- not acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
- acc|success
|
||||
- not acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "disabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
- acc|success
|
||||
- not acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "disabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
- acc|success
|
||||
- not acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -177,7 +177,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
- acc|success
|
||||
- not acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -233,7 +233,7 @@
|
|||
last_name: "{{ cs_resource_prefix }}_last_name"
|
||||
first_name: "{{ cs_resource_prefix }}_first_name"
|
||||
email: "{{ cs_resource_prefix }}@example.com"
|
||||
network_domain: "{{ cs_resource_prefix }}.local"
|
||||
network_domain: "example.com"
|
||||
state: disabled
|
||||
register: acc
|
||||
- name: verify results of create disabled account
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "disabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -258,7 +258,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "disabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -271,7 +271,7 @@
|
|||
last_name: "{{ cs_resource_prefix }}_last_name"
|
||||
first_name: "{{ cs_resource_prefix }}_first_name"
|
||||
email: "{{ cs_resource_prefix }}@example.com"
|
||||
network_domain: "{{ cs_resource_prefix }}.local"
|
||||
network_domain: "example.com"
|
||||
state: locked
|
||||
register: acc
|
||||
- name: verify results of create locked account
|
||||
|
|
@ -280,7 +280,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "locked"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -309,7 +309,7 @@
|
|||
last_name: "{{ cs_resource_prefix }}_last_name"
|
||||
first_name: "{{ cs_resource_prefix }}_first_name"
|
||||
email: "{{ cs_resource_prefix }}@example.com"
|
||||
network_domain: "{{ cs_resource_prefix }}.local"
|
||||
network_domain: "example.com"
|
||||
state: unlocked
|
||||
register: acc
|
||||
- name: verify results of create unlocked/enabled account
|
||||
|
|
@ -318,7 +318,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
@ -334,7 +334,7 @@
|
|||
- acc|success
|
||||
- acc|changed
|
||||
- acc.name == "{{ cs_resource_prefix }}_user"
|
||||
- acc.network_domain == "{{ cs_resource_prefix }}.local"
|
||||
- acc.network_domain == "example.com"
|
||||
- acc.account_type == "user"
|
||||
- acc.state == "enabled"
|
||||
- acc.domain == "ROOT"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
5
test/integration/targets/cs_common/defaults/main.yml
Normal file
5
test/integration/targets/cs_common/defaults/main.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
cs_resource_prefix: "cs-{{ (ansible_date_time.iso8601_micro | to_uuid).split('-')[0] }}"
|
||||
cs_common_template: CentOS 5.6 (64-bit) no GUI (Simulator)
|
||||
cs_common_service_offering: Small Instance
|
||||
cs_common_zone_adv: Sandbox-simulator-advanced
|
||||
3
test/integration/targets/cs_configuration/aliases
Normal file
3
test/integration/targets/cs_configuration/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
test_cs_configuration_storage: PS0-adv
|
||||
test_cs_configuration_cluster: C0-basic
|
||||
test_cs_configuration_account: admin
|
||||
test_cs_configuration_zone: Sandbox-simulator-basic
|
||||
3
test/integration/targets/cs_configuration/meta/main.yml
Normal file
3
test/integration/targets/cs_configuration/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
3
test/integration/targets/cs_firewall/aliases
Normal file
3
test/integration/targets/cs_firewall/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
cs_firewall_ip_address: 10.100.212.5
|
||||
cs_firewall_network: test
|
||||
cs_firewall_network: ansible test
|
||||
3
test/integration/targets/cs_firewall/meta/main.yml
Normal file
3
test/integration/targets/cs_firewall/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,8 +1,35 @@
|
|||
---
|
||||
- name: network setup
|
||||
cs_network:
|
||||
name: "{{ cs_firewall_network }}"
|
||||
network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
|
||||
network_domain: example.com
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: net
|
||||
- name: verify network setup
|
||||
assert:
|
||||
that:
|
||||
- net|success
|
||||
|
||||
- name: public ip address setup
|
||||
cs_ip_address:
|
||||
network: ansible test
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: ip_address
|
||||
- name: verify public ip address setup
|
||||
assert:
|
||||
that:
|
||||
- ip_address|success
|
||||
|
||||
- name: set ip address as fact
|
||||
set_fact:
|
||||
cs_firewall_ip_address: "{{ ip_address.ip_address }}"
|
||||
|
||||
- name: setup 80
|
||||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify setup
|
||||
|
|
@ -17,6 +44,7 @@
|
|||
start_port: 5300
|
||||
end_port: 5333
|
||||
cidr: 1.2.3.4/24
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify setup
|
||||
|
|
@ -29,6 +57,7 @@
|
|||
network: "{{ cs_firewall_network }}"
|
||||
protocol: all
|
||||
type: egress
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify setup
|
||||
|
|
@ -44,34 +73,37 @@
|
|||
assert:
|
||||
that:
|
||||
- fw|failed
|
||||
- fw.msg == "missing required argument for protocol 'tcp': start_port or end_port"
|
||||
- "fw.msg == 'one of the following is required: ip_address,network'"
|
||||
|
||||
- name: test fail if missing params ip_address ingress
|
||||
- name: test fail if missing params
|
||||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
ignore_errors: true
|
||||
- name: verify results of fail if missing params ip_address
|
||||
- name: verify results of fail if missing params
|
||||
assert:
|
||||
that:
|
||||
- fw|failed
|
||||
- fw.msg == "missing required argument for type ingress: ip_address"
|
||||
- "fw.msg == \"missing required argument for protocol 'tcp': start_port or end_port\""
|
||||
|
||||
- name: test fail if missing params network egress
|
||||
cs_firewall:
|
||||
type: egress
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
ignore_errors: true
|
||||
- name: verify results of fail if missing params ip_address
|
||||
assert:
|
||||
that:
|
||||
- fw|failed
|
||||
- fw.msg == "missing required argument for type egress: network"
|
||||
- "fw.msg == 'one of the following is required: ip_address,network'"
|
||||
|
||||
- name: test present firewall rule ingress 80
|
||||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule ingress 80
|
||||
assert:
|
||||
|
|
@ -89,6 +121,7 @@
|
|||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule ingress 80 idempotence
|
||||
assert:
|
||||
|
|
@ -109,6 +142,7 @@
|
|||
start_port: 5300
|
||||
end_port: 5333
|
||||
cidr: 1.2.3.4/24
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule ingress 5300
|
||||
assert:
|
||||
|
|
@ -129,6 +163,7 @@
|
|||
start_port: 5300
|
||||
end_port: 5333
|
||||
cidr: 1.2.3.4/24
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule ingress 5300 idempotence
|
||||
assert:
|
||||
|
|
@ -147,6 +182,7 @@
|
|||
network: "{{ cs_firewall_network }}"
|
||||
protocol: all
|
||||
type: egress
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule egress all
|
||||
assert:
|
||||
|
|
@ -163,6 +199,7 @@
|
|||
network: "{{ cs_firewall_network }}"
|
||||
protocol: all
|
||||
type: egress
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of present firewall rule egress all idempotence
|
||||
assert:
|
||||
|
|
@ -178,6 +215,7 @@
|
|||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule ingress 80
|
||||
|
|
@ -196,6 +234,7 @@
|
|||
cs_firewall:
|
||||
port: 80
|
||||
ip_address: "{{ cs_firewall_ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule ingress 80 idempotence
|
||||
|
|
@ -211,6 +250,7 @@
|
|||
start_port: 5300
|
||||
end_port: 5333
|
||||
cidr: 1.2.3.4/24
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule ingress 5300
|
||||
|
|
@ -232,6 +272,7 @@
|
|||
start_port: 5300
|
||||
end_port: 5333
|
||||
cidr: 1.2.3.4/24
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule ingress 5300 idempotence
|
||||
|
|
@ -246,6 +287,7 @@
|
|||
protocol: all
|
||||
type: egress
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule egress all
|
||||
assert:
|
||||
|
|
@ -262,6 +304,7 @@
|
|||
network: "{{ cs_firewall_network }}"
|
||||
protocol: all
|
||||
type: egress
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: fw
|
||||
- name: verify results of absent firewall rule egress all idempotence
|
||||
|
|
@ -269,3 +312,14 @@
|
|||
that:
|
||||
- fw|success
|
||||
- not fw|changed
|
||||
|
||||
- name: network cleanup
|
||||
cs_network:
|
||||
name: "{{ cs_firewall_network }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: net
|
||||
- name: verify network cleanup
|
||||
assert:
|
||||
that:
|
||||
- net|success
|
||||
3
test/integration/targets/cs_instance/aliases
Normal file
3
test/integration/targets/cs_instance/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
instance_number: 1
|
||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||
test_cs_instance_template: "{{ cs_common_template }}"
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
test_cs_instance_offering_2: Medium Instance
|
||||
3
test/integration/targets/cs_instance/meta/main.yml
Normal file
3
test/integration/targets/cs_instance/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
3
test/integration/targets/cs_instance_facts/aliases
Normal file
3
test/integration/targets/cs_instance_facts/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
test_cs_instance_template: "{{ cs_common_template }}"
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
3
test/integration/targets/cs_instance_facts/meta/main.yml
Normal file
3
test/integration/targets/cs_instance_facts/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
3
test/integration/targets/cs_iso/aliases
Normal file
3
test/integration/targets/cs_iso/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
3
test/integration/targets/cs_iso/meta/main.yml
Normal file
3
test/integration/targets/cs_iso/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
3
test/integration/targets/cs_loadbalancer_rule/aliases
Normal file
3
test/integration/targets/cs_loadbalancer_rule/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,25 +1,53 @@
|
|||
---
|
||||
- name: setup
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify setup
|
||||
- name: test create network for lb
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_lb"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network_offering: Offering for Isolated networks with Source Nat service enabled
|
||||
register: lb_net
|
||||
- name: verify test create network for lb
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- lb_net|success
|
||||
- lb_net|changed
|
||||
- lb_net.name == "{{ cs_resource_prefix }}_net_lb"
|
||||
|
||||
- name: setup instance
|
||||
- name: setup instance in lb
|
||||
cs_instance:
|
||||
name: "{{ test_cs_lb_member }}"
|
||||
template: "{{ test_cs_instance_template }}"
|
||||
service_offering: "{{ test_cs_instance_offering_1 }}"
|
||||
name: "{{ cs_resource_prefix }}-vm-lb"
|
||||
template: "{{ cs_common_template }}"
|
||||
service_offering: "{{ cs_common_service_offering }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network: "{{ cs_resource_prefix }}_net_lb"
|
||||
register: instance
|
||||
- name: verify create instance
|
||||
- name: verify setup instance in lb
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- instance|changed
|
||||
- instance.name == "{{ cs_resource_prefix }}-vm-lb"
|
||||
- instance.state == "Running"
|
||||
|
||||
- name: setup get ip address for lb
|
||||
cs_ip_address:
|
||||
network: "{{ cs_resource_prefix }}_net_lb"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: ip_address
|
||||
- name: verify setup instance in lb
|
||||
assert:
|
||||
that:
|
||||
- ip_address|success
|
||||
|
||||
- name: setup lb rule absent
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify setup lb rule absent
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
|
||||
- name: test rule requires params
|
||||
cs_loadbalancer_rule:
|
||||
|
|
@ -34,7 +62,7 @@
|
|||
- name: test create rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: roundrobin
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
|
|
@ -46,33 +74,33 @@
|
|||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "roundrobin"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test create rule idempotence
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: roundrobin
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
register: lb
|
||||
- name: verify test create rule idempotence
|
||||
- name: verify test create rule idempotence
|
||||
assert:
|
||||
that:
|
||||
- lb|success
|
||||
- not lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "roundrobin"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test update rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: source
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
|
|
@ -84,14 +112,14 @@
|
|||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test update rule idempotence
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
algorithm: source
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
|
|
@ -103,7 +131,7 @@
|
|||
- not lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
|
|
@ -120,7 +148,7 @@
|
|||
- name: test add members to rule
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ test_cs_lb_member }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
register: lb
|
||||
- name: verify add members to rule
|
||||
assert:
|
||||
|
|
@ -129,15 +157,15 @@
|
|||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
- "'{{ test_cs_lb_member }}' in lb.vms"
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
|
||||
|
||||
- name: test add members to rule idempotence
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ test_cs_lb_member }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
register: lb
|
||||
- name: verify add members to rule idempotence
|
||||
assert:
|
||||
|
|
@ -146,15 +174,15 @@
|
|||
- not lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
- "'{{ test_cs_lb_member }}' in lb.vms"
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
|
||||
|
||||
- name: test remove members to rule
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ test_cs_lb_member }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify remove members to rule
|
||||
|
|
@ -164,15 +192,15 @@
|
|||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
- "'{{ test_cs_lb_member }}' not in lb.vms"
|
||||
- "'{{ cs_resource_prefix }}-vm-lb' not in lb.vms"
|
||||
|
||||
- name: test remove members to rule idempotence
|
||||
cs_loadbalancer_rule_member:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
vm: "{{ test_cs_lb_member }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-lb"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify remove members to rule
|
||||
|
|
@ -184,7 +212,7 @@
|
|||
- name: test remove rule
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify remove rule
|
||||
|
|
@ -194,14 +222,14 @@
|
|||
- lb|changed
|
||||
- lb.name == "{{ cs_resource_prefix }}_lb"
|
||||
- lb.algorithm == "source"
|
||||
- lb.public_ip == "{{ test_cs_lb_public_ip }}"
|
||||
- lb.public_ip == "{{ ip_address.ip_address }}"
|
||||
- lb.public_port == 80
|
||||
- lb.private_port == 8080
|
||||
|
||||
- name: test remove rule idempotence
|
||||
cs_loadbalancer_rule:
|
||||
name: "{{ cs_resource_prefix }}_lb"
|
||||
public_ip: "{{ test_cs_lb_public_ip }}"
|
||||
public_ip: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: lb
|
||||
- name: verify remove rule idempotence
|
||||
3
test/integration/targets/cs_pod/aliases
Normal file
3
test/integration/targets/cs_pod/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
3
test/integration/targets/cs_pod/meta/main.yml
Normal file
3
test/integration/targets/cs_pod/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,14 +1,4 @@
|
|||
---
|
||||
- name: setup pod is absent
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
state: absent
|
||||
register: pod
|
||||
- name: verify setup pod is absent
|
||||
assert:
|
||||
that:
|
||||
- pod|success
|
||||
|
||||
- name: setup zone is present
|
||||
cs_zone:
|
||||
name: "{{ cs_resource_prefix }}-zone"
|
||||
|
|
@ -21,6 +11,17 @@
|
|||
that:
|
||||
- zone|success
|
||||
|
||||
- name: setup pod is absent
|
||||
cs_pod:
|
||||
name: "{{ cs_resource_prefix }}-pod"
|
||||
zone: "{{ cs_resource_prefix }}-zone"
|
||||
state: absent
|
||||
register: pod
|
||||
- name: verify setup pod is absent
|
||||
assert:
|
||||
that:
|
||||
- pod|success
|
||||
|
||||
- name: test fail if missing name
|
||||
cs_pod:
|
||||
register: pod
|
||||
3
test/integration/targets/cs_portforward/aliases
Normal file
3
test/integration/targets/cs_portforward/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
cs_portforward_public_ip: "10.100.212.5"
|
||||
cs_portforward_vm: "cs-{{ cs_resource_prefix }}-pf-vm"
|
||||
3
test/integration/targets/cs_portforward/meta/main.yml
Normal file
3
test/integration/targets/cs_portforward/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
|
|
@ -1,12 +1,52 @@
|
|||
---
|
||||
- name: setup
|
||||
- name: network setup
|
||||
cs_network:
|
||||
name: ansible test
|
||||
network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
|
||||
network_domain: example.com
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: net
|
||||
- name: verify network setup
|
||||
assert:
|
||||
that:
|
||||
- net|success
|
||||
|
||||
- name: instance setup
|
||||
cs_instance:
|
||||
name: "{{ cs_portforward_vm }}"
|
||||
template: "{{ cs_common_template }}"
|
||||
service_offering: "{{ cs_common_service_offering }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network: "ansible test"
|
||||
register: instance
|
||||
- name: verify instance setup
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
|
||||
- name: public ip address setup
|
||||
cs_ip_address:
|
||||
network: ansible test
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: ip_address
|
||||
- name: verify public ip address setup
|
||||
assert:
|
||||
that:
|
||||
- ip_address|success
|
||||
|
||||
- name: set ip address as fact
|
||||
set_fact:
|
||||
cs_portforward_public_ip: "{{ ip_address.ip_address }}"
|
||||
|
||||
- name: clear existing port forwarding
|
||||
cs_portforward:
|
||||
ip_address: "{{ cs_portforward_public_ip }}"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify setup
|
||||
- name: verify clear existing port forwarding
|
||||
assert:
|
||||
that:
|
||||
- pf|success
|
||||
|
|
@ -27,6 +67,7 @@
|
|||
public_port: 80
|
||||
vm: "{{ cs_portforward_vm }}"
|
||||
private_port: 8080
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify results of present port forwarding
|
||||
assert:
|
||||
|
|
@ -46,6 +87,7 @@
|
|||
public_port: 80
|
||||
vm: "{{ cs_portforward_vm }}"
|
||||
private_port: 8080
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify results of present port forwarding idempotence
|
||||
assert:
|
||||
|
|
@ -65,6 +107,7 @@
|
|||
public_port: 80
|
||||
vm: "{{ cs_portforward_vm }}"
|
||||
private_port: 8888
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify results of change port forwarding
|
||||
assert:
|
||||
|
|
@ -84,6 +127,7 @@
|
|||
public_port: 80
|
||||
private_port: 8888
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify results of absent port forwarding
|
||||
assert:
|
||||
|
|
@ -103,9 +147,32 @@
|
|||
public_port: 80
|
||||
private_port: 8888
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: pf
|
||||
- name: verify results of absent port forwarding idempotence
|
||||
assert:
|
||||
that:
|
||||
- pf|success
|
||||
- not pf|changed
|
||||
|
||||
- name: instance cleanup
|
||||
cs_instance:
|
||||
name: "{{ cs_portforward_vm }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: expunged
|
||||
register: instance
|
||||
- name: verify instance cleanup
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
|
||||
- name: network cleanup
|
||||
cs_network:
|
||||
name: ansible test
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: net
|
||||
- name: verify network cleanup
|
||||
assert:
|
||||
that:
|
||||
- net|success
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
---
|
||||
- name: setup cleanup
|
||||
cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
|
||||
cs_sshkeypair: name=first-sshkey state=absent
|
||||
|
||||
- name: setup cleanup
|
||||
cs_sshkeypair: name=second-sshkey state=absent
|
||||
|
||||
|
||||
- name: test fail on missing name
|
||||
action: cs_sshkeypair
|
||||
|
|
@ -13,7 +17,8 @@
|
|||
- "sshkey.msg == 'missing required arguments: name'"
|
||||
|
||||
- name: test ssh key creation
|
||||
cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey
|
||||
cs_sshkeypair:
|
||||
name: "first-sshkey"
|
||||
register: sshkey
|
||||
- name: verify results of ssh key creation
|
||||
assert:
|
||||
|
|
@ -22,10 +27,11 @@
|
|||
- sshkey|changed
|
||||
- sshkey.fingerprint is defined and sshkey.fingerprint != ""
|
||||
- sshkey.private_key is defined and sshkey.private_key != ""
|
||||
- sshkey.name == "{{ cs_resource_prefix }}-sshkey"
|
||||
- sshkey.name == "first-sshkey"
|
||||
|
||||
- name: test ssh key creation idempotence
|
||||
cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey
|
||||
cs_sshkeypair:
|
||||
name: "first-sshkey"
|
||||
register: sshkey2
|
||||
- name: verify results of ssh key creation idempotence
|
||||
assert:
|
||||
|
|
@ -34,12 +40,12 @@
|
|||
- not sshkey2|changed
|
||||
- sshkey2.fingerprint is defined and sshkey2.fingerprint == sshkey.fingerprint
|
||||
- sshkey2.private_key is not defined
|
||||
- sshkey2.name == "{{ cs_resource_prefix }}-sshkey"
|
||||
- sshkey2.name == "first-sshkey"
|
||||
|
||||
- name: test replace ssh public key
|
||||
cs_sshkeypair: |
|
||||
name={{ cs_resource_prefix }}-sshkey
|
||||
public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
|
||||
cs_sshkeypair:
|
||||
name: "first-sshkey"
|
||||
public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
|
||||
register: sshkey3
|
||||
- name: verify results of replace ssh public key
|
||||
assert:
|
||||
|
|
@ -48,12 +54,12 @@
|
|||
- sshkey3|changed
|
||||
- sshkey3.fingerprint is defined and sshkey3.fingerprint != sshkey2.fingerprint
|
||||
- sshkey3.private_key is not defined
|
||||
- sshkey3.name == "{{ cs_resource_prefix }}-sshkey"
|
||||
- sshkey3.name == "first-sshkey"
|
||||
|
||||
- name: test replace ssh public key idempotence
|
||||
cs_sshkeypair: |
|
||||
name={{ cs_resource_prefix }}-sshkey
|
||||
public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
|
||||
cs_sshkeypair:
|
||||
name: "first-sshkey"
|
||||
public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
|
||||
register: sshkey4
|
||||
- name: verify results of ssh public key idempotence
|
||||
assert:
|
||||
|
|
@ -62,10 +68,28 @@
|
|||
- not sshkey4|changed
|
||||
- sshkey4.fingerprint is defined and sshkey4.fingerprint == sshkey3.fingerprint
|
||||
- sshkey4.private_key is not defined
|
||||
- sshkey4.name == "{{ cs_resource_prefix }}-sshkey"
|
||||
- sshkey4.name == "first-sshkey"
|
||||
|
||||
- name: setup ssh key with name "second-sshke"
|
||||
cs_sshkeypair:
|
||||
name: "second-sshkey"
|
||||
|
||||
- name: test different but exisitng name but same ssh public key as first-sshkey
|
||||
cs_sshkeypair:
|
||||
name: "second-sshkey"
|
||||
public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
|
||||
register: sshkey
|
||||
- name: verify test different but exisitng name but same ssh public key as first-sshkey
|
||||
assert:
|
||||
that:
|
||||
- sshkey|success
|
||||
- sshkey|changed
|
||||
- sshkey.fingerprint is defined and sshkey.fingerprint == sshkey4.fingerprint
|
||||
- sshkey.private_key is not defined
|
||||
- sshkey.name == "second-sshkey"
|
||||
|
||||
- name: test ssh key absent
|
||||
cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
|
||||
cs_sshkeypair: name=second-sshkey state=absent
|
||||
register: sshkey5
|
||||
- name: verify result of key absent
|
||||
assert:
|
||||
|
|
@ -74,10 +98,10 @@
|
|||
- sshkey5|changed
|
||||
- sshkey5.fingerprint is defined and sshkey5.fingerprint == sshkey3.fingerprint
|
||||
- sshkey5.private_key is not defined
|
||||
- sshkey5.name == "{{ cs_resource_prefix }}-sshkey"
|
||||
- sshkey5.name == "second-sshkey"
|
||||
|
||||
- name: test ssh key absent idempotence
|
||||
cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
|
||||
cs_sshkeypair: name=second-sshkey state=absent
|
||||
register: sshkey6
|
||||
- name: verify result of ssh key absent idempotence
|
||||
assert:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- test_cs_common
|
||||
- cs_common
|
||||
|
|
|
|||
3
test/integration/targets/cs_vmsnapshot/aliases
Normal file
3
test/integration/targets/cs_vmsnapshot/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
3
test/integration/targets/cs_vmsnapshot/defaults/main.yml
Normal file
3
test/integration/targets/cs_vmsnapshot/defaults/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
test_cs_instance_template: "{{ cs_common_template }}"
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
3
test/integration/targets/cs_vmsnapshot/meta/main.yml
Normal file
3
test/integration/targets/cs_vmsnapshot/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
3
test/integration/targets/cs_volume/aliases
Normal file
3
test/integration/targets/cs_volume/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
test_cs_instance_1: "{{ cs_resource_prefix }}-vm1"
|
||||
test_cs_instance_2: "{{ cs_resource_prefix }}-vm2"
|
||||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
|
||||
test_cs_instance_template: "{{ cs_common_template }}"
|
||||
test_cs_instance_offering_1: Small Instance
|
||||
test_cs_disk_offering_1: Custom
|
||||
3
test/integration/targets/cs_volume/meta/main.yml
Normal file
3
test/integration/targets/cs_volume/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
3
test/integration/targets/cs_vpc/aliases
Normal file
3
test/integration/targets/cs_vpc/aliases
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
cloud/cs
|
||||
posix/ci/cloud/cs
|
||||
skip/python3
|
||||
3
test/integration/targets/cs_vpc/meta/main.yml
Normal file
3
test/integration/targets/cs_vpc/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- cs_common
|
||||
399
test/integration/targets/cs_vpc/tasks/main.yml
Normal file
399
test/integration/targets/cs_vpc/tasks/main.yml
Normal file
|
|
@ -0,0 +1,399 @@
|
|||
---
|
||||
- name: setup
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
register: vpc
|
||||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
|
||||
- name: test fail missing name
|
||||
cs_vpc:
|
||||
ignore_errors: true
|
||||
register: vpc
|
||||
- name: verify test fail missing name
|
||||
assert:
|
||||
that:
|
||||
- vpc|failed
|
||||
- 'vpc.msg == "missing required arguments: name"'
|
||||
|
||||
- name: test fail missing cidr
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
ignore_errors: true
|
||||
register: vpc
|
||||
- name: verify test fail missing name
|
||||
assert:
|
||||
that:
|
||||
- vpc|failed
|
||||
- 'vpc.msg == "state is present but the following are missing: cidr"'
|
||||
|
||||
- name: test create vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test create vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test create vpc idempotence
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test create vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- not vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test create vpc idempotence2
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test create vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- not vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test update vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text2"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test create vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test update vpc idempotence
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
display_text: "{{ cs_resource_prefix }}_display_text2"
|
||||
cidr: 10.10.0.0/16
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test create vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- not vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test create network in vpc
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network_offering: Offering for Isolated Vpc networks with Source Nat service enabled
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
gateway: 10.10.0.1
|
||||
netmask: 255.255.255.0
|
||||
register: vpc_net
|
||||
- name: verify test create network in vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- vpc_net|changed
|
||||
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
||||
- name: test create network in vpc idempotence
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network_offering: Offering for Isolated Vpc networks with Source Nat service enabled
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
gateway: 10.10.0.1
|
||||
netmask: 255.255.255.0
|
||||
register: vpc_net
|
||||
- name: verify test create network in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- not vpc_net|changed
|
||||
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
||||
- name: test create instance in vpc
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
template: "{{ cs_common_template }}"
|
||||
service_offering: "{{ cs_common_service_offering }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: instance
|
||||
- name: verify test create instance in vpc
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- instance|changed
|
||||
- instance.name == "{{ cs_resource_prefix }}-vm-vpc"
|
||||
- instance.state == "Running"
|
||||
|
||||
- name: test create instance in vpc idempotence
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
template: "{{ cs_common_template }}"
|
||||
service_offering: "{{ cs_common_service_offering }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: instance
|
||||
- name: verify test create instance in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- not instance|changed
|
||||
- instance.name == "{{ cs_resource_prefix }}-vm-vpc"
|
||||
- instance.state == "Running"
|
||||
|
||||
- name: test get ip address in vpc
|
||||
cs_ip_address:
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: ip_address
|
||||
when: instance.public_ip is undefined
|
||||
|
||||
- name: test static nat in vpc
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: static_nat
|
||||
- name: verify test static nat in vpc
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- static_nat|changed
|
||||
|
||||
- name: test static nat in vpc idempotence
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
register: static_nat
|
||||
- name: verify test static nat in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- not static_nat|changed
|
||||
|
||||
- name: test remove static nat in vpc
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
state: absent
|
||||
register: static_nat
|
||||
- name: verify test remove static nat in vpc
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- static_nat|changed
|
||||
|
||||
- name: test remove static nat in vpc idempotence
|
||||
cs_staticnat:
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
state: absent
|
||||
register: static_nat
|
||||
- name: verify test remove static nat in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- static_nat|success
|
||||
- not static_nat|changed
|
||||
|
||||
- name: test create port forwarding in vpc
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: port_forward
|
||||
- name: verify test create port forwarding in vpc
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- port_forward|changed
|
||||
|
||||
- name: test create port forwarding in vpc idempotence
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: port_forward
|
||||
- name: verify test create port forwarding in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- not port_forward|changed
|
||||
|
||||
- name: test remove port forwarding in vpc
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: port_forward
|
||||
- name: verify test remove port forwarding in vpc
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- port_forward|changed
|
||||
|
||||
- name: test remove port forwarding in vpc idempotence
|
||||
cs_portforward:
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
vm: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
public_port: 80
|
||||
private_port: 8080
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: absent
|
||||
register: port_forward
|
||||
- name: verify test remove port forwarding in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- port_forward|success
|
||||
- not port_forward|changed
|
||||
|
||||
- name: test remove ip address from vpc
|
||||
cs_ip_address:
|
||||
network: "{{ cs_resource_prefix }}_net_vpc"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
ip_address: "{{ ip_address.ip_address }}"
|
||||
state: absent
|
||||
register: ip_address_removed
|
||||
- name: verify test remove static nat in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- ip_address_removed|success
|
||||
- ip_address_removed|changed
|
||||
|
||||
- name: test remove instance in vpc
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: expunged
|
||||
register: instance
|
||||
- name: verify test remove instance in vpc
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- instance|changed
|
||||
- instance.name == "{{ cs_resource_prefix }}-vm-vpc"
|
||||
- instance.state == "Running"
|
||||
|
||||
- name: test remove instance in vpc idempotence
|
||||
cs_instance:
|
||||
name: "{{ cs_resource_prefix }}-vm-vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
state: expunged
|
||||
register: instance
|
||||
- name: verify test remove instance in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- instance|success
|
||||
- not instance|changed
|
||||
|
||||
- name: test remove network in vpc
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
register: vpc_net
|
||||
- name: verify test remove network in vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- vpc_net|changed
|
||||
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
||||
|
||||
- name: test remove network in vpc idempotence
|
||||
cs_network:
|
||||
name: "{{ cs_resource_prefix }}_net_vpc"
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
vpc: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
register: vpc_net
|
||||
- name: verify test remove network in vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- vpc_net|success
|
||||
- not vpc_net|changed
|
||||
|
||||
- name: test remove vpc
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
zone: "{{ cs_common_zone_adv }}"
|
||||
register: vpc
|
||||
- name: verify test remove vpc
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- vpc|changed
|
||||
- vpc.name == "{{ cs_resource_prefix }}_vpc"
|
||||
- vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
|
||||
- vpc.cidr == "10.10.0.0/16"
|
||||
|
||||
- name: test remove vpc idempotence
|
||||
cs_vpc:
|
||||
name: "{{ cs_resource_prefix }}_vpc"
|
||||
state: absent
|
||||
register: vpc
|
||||
- name: verify test remove vpc idempotence
|
||||
assert:
|
||||
that:
|
||||
- vpc|success
|
||||
- not vpc|changed
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
cs_resource_prefix: cloudstack
|
||||
Loading…
Add table
Add a link
Reference in a new issue