1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/cs_vpn_gateway/tasks/main.yml
René Moser 2ef6713abb cloudstack: new module cs_vpn_gateway (#23954)
* cloudstack: new module cs_vpn_gateway
* add integration tests for cs_vpn_gateway
2017-05-10 14:55:14 +02:00

82 lines
2.1 KiB
YAML

---
- name: setup 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 setup vpc
assert:
that:
- vpc|success
- name: setup vpn gateway absent
cs_vpn_gateway:
vpc: "{{ cs_resource_prefix }}_vpc"
zone: "{{ cs_common_zone_adv }}"
state: absent
register: vpn_gateway
- name: verify setup vpn gateway absent
assert:
that:
- vpn_gateway|success
- name: test fail missing param vpc for vpn gateway
cs_vpn_gateway:
ignore_errors: true
register: vpn_gateway
- name: verify test fail missing param vpc for vpn gateway
assert:
that:
- vpn_gateway|failed
- "vpn_gateway.msg.startswith('missing required arguments: ')"
- name: test create vpn gateway
cs_vpn_gateway:
vpc: "{{ cs_resource_prefix }}_vpc"
zone: "{{ cs_common_zone_adv }}"
register: vpn_gateway
- name: verify test create vpn gateway
assert:
that:
- vpn_gateway|success
- vpn_gateway|changed
- vpn_gateway.vpc == "{{ cs_resource_prefix }}_vpc"
- name: test create vpn gateway idempotence
cs_vpn_gateway:
vpc: "{{ cs_resource_prefix }}_vpc"
zone: "{{ cs_common_zone_adv }}"
register: vpn_gateway
- name: verify test create vpn gateway idempotence
assert:
that:
- vpn_gateway|success
- not vpn_gateway|changed
- vpn_gateway.vpc == "{{ cs_resource_prefix }}_vpc"
- name: test remove vpn gateway
cs_vpn_gateway:
vpc: "{{ cs_resource_prefix }}_vpc"
zone: "{{ cs_common_zone_adv }}"
state: absent
register: vpn_gateway
- name: verify test remove vpn gateway
assert:
that:
- vpn_gateway|success
- vpn_gateway|changed
- vpn_gateway.vpc == "{{ cs_resource_prefix }}_vpc"
- name: test remove vpn gateway idempotence
cs_vpn_gateway:
vpc: "{{ cs_resource_prefix }}_vpc"
zone: "{{ cs_common_zone_adv }}"
state: absent
register: vpn_gateway
- name: verify test remove vpn gateway idempotence
assert:
that:
- vpn_gateway|success
- not vpn_gateway|changed