2017-05-09 03:32:11 +00:00
|
|
|
---
|
|
|
|
- name: setup
|
|
|
|
cs_vpc:
|
|
|
|
name: "{{ cs_resource_prefix }}_vpc"
|
2017-05-15 14:36:58 +00:00
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
2017-05-09 03:32:11 +00:00
|
|
|
state: absent
|
|
|
|
register: vpc
|
|
|
|
- name: verify setup
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc|success
|
|
|
|
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: test fail missing name of vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
cs_vpc:
|
2017-05-15 14:36:58 +00:00
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
2017-05-09 03:32:11 +00:00
|
|
|
ignore_errors: true
|
|
|
|
register: vpc
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: verify test fail missing name of vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc|failed
|
2017-05-10 12:55:14 +00:00
|
|
|
- "vpc.msg.startswith('missing required arguments: ')"
|
2017-05-09 03:32:11 +00:00
|
|
|
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: test fail missing cidr for vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
cs_vpc:
|
|
|
|
name: "{{ cs_resource_prefix }}_vpc"
|
2017-05-15 14:36:58 +00:00
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
2017-05-09 03:32:11 +00:00
|
|
|
ignore_errors: true
|
|
|
|
register: vpc
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: verify test fail missing cidr for vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc|failed
|
|
|
|
- 'vpc.msg == "state is present but the following are missing: cidr"'
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc|success
|
|
|
|
- vpc|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: verify test create vpc idempotence2
|
2017-05-09 03:32:11 +00:00
|
|
|
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"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test update vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test update vpc in check mode
|
|
|
|
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"
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: verify test update vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
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
|
2017-05-10 12:55:14 +00:00
|
|
|
- name: verify test update vpc idempotence
|
2017-05-09 03:32:11 +00:00
|
|
|
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"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create network in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create network in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc_net|success
|
|
|
|
- vpc_net|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create instance in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create instance in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- instance|success
|
|
|
|
- instance|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test static nat in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test static nat in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- static_nat|success
|
|
|
|
- static_nat|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test remove static nat in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test remove static nat in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- static_nat|success
|
|
|
|
- static_nat|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create port forwarding in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create port forwarding in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- port_forward|success
|
|
|
|
- port_forward|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test remove port forwarding in vpc in check mode
|
|
|
|
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
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test remove port forwarding in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- port_forward|success
|
|
|
|
- port_forward|changed
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: verify test remove ip address from vpc
|
2017-05-09 03:32:11 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- ip_address_removed|success
|
|
|
|
- ip_address_removed|changed
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test remove instance in vpc in check mdoe
|
|
|
|
cs_instance:
|
|
|
|
name: "{{ cs_resource_prefix }}-vm-vpc"
|
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
|
|
|
state: expunged
|
|
|
|
register: instance
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test remove instance in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- instance|success
|
|
|
|
- instance|changed
|
|
|
|
- instance.name == "{{ cs_resource_prefix }}-vm-vpc"
|
|
|
|
- instance.state == "Running"
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test remove network in vpc in check mode
|
|
|
|
cs_network:
|
|
|
|
name: "{{ cs_resource_prefix }}_net_vpc"
|
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
|
|
|
vpc: "{{ cs_resource_prefix }}_vpc"
|
|
|
|
state: absent
|
|
|
|
register: vpc_net
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test remove network in vpc in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vpc_net|success
|
|
|
|
- vpc_net|changed
|
|
|
|
- vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test remove vpc in check mode
|
|
|
|
cs_vpc:
|
|
|
|
name: "{{ cs_resource_prefix }}_vpc"
|
|
|
|
state: absent
|
|
|
|
zone: "{{ cs_common_zone_adv }}"
|
|
|
|
register: vpc
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test remove vpc in check mode
|
|
|
|
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"
|
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- 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
|