Skip to content

Commit d164ba8

Browse files
committed
add vpn_gateway
1 parent 1f14a5c commit d164ba8

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cloud/cs
2+
cs/group2
3+
cs/group3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
dependencies:
3+
- cs_common
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
- name: setup vpc
3+
ngine_io.cloudstack.vpc:
4+
name: "{{ cs_resource_prefix }}_vpc"
5+
display_text: "{{ cs_resource_prefix }}_display_text"
6+
cidr: 10.10.0.0/16
7+
zone: "{{ cs_common_zone_adv }}"
8+
register: vpc
9+
- name: verify setup vpc
10+
assert:
11+
that:
12+
- vpc is successful
13+
14+
- name: setup vpn gateway absent
15+
ngine_io.cloudstack.vpn_gateway:
16+
vpc: "{{ cs_resource_prefix }}_vpc"
17+
zone: "{{ cs_common_zone_adv }}"
18+
state: absent
19+
register: vpn_gateway
20+
- name: verify setup vpn gateway absent
21+
assert:
22+
that:
23+
- vpn_gateway is successful
24+
25+
- name: test fail missing param vpc for vpn gateway
26+
ngine_io.cloudstack.vpn_gateway:
27+
ignore_errors: true
28+
register: vpn_gateway
29+
- name: verify test fail missing param vpc for vpn gateway
30+
assert:
31+
that:
32+
- vpn_gateway is failed
33+
- "vpn_gateway.msg.startswith('missing required arguments: ')"
34+
35+
- name: test create vpn gateway in check mode
36+
ngine_io.cloudstack.vpn_gateway:
37+
vpc: "{{ cs_resource_prefix }}_vpc"
38+
zone: "{{ cs_common_zone_adv }}"
39+
register: vpn_gateway
40+
check_mode: true
41+
- name: verify test create vpn gateway in check mode
42+
assert:
43+
that:
44+
- vpn_gateway is successful
45+
- vpn_gateway is changed
46+
47+
- name: test create vpn gateway
48+
ngine_io.cloudstack.vpn_gateway:
49+
vpc: "{{ cs_resource_prefix }}_vpc"
50+
zone: "{{ cs_common_zone_adv }}"
51+
register: vpn_gateway
52+
- name: verify test create vpn gateway
53+
assert:
54+
that:
55+
- vpn_gateway is successful
56+
- vpn_gateway is changed
57+
- vpn_gateway.vpc == cs_resource_prefix + "_vpc"
58+
59+
- name: test create vpn gateway idempotence
60+
ngine_io.cloudstack.vpn_gateway:
61+
vpc: "{{ cs_resource_prefix }}_vpc"
62+
zone: "{{ cs_common_zone_adv }}"
63+
register: vpn_gateway
64+
- name: verify test create vpn gateway idempotence
65+
assert:
66+
that:
67+
- vpn_gateway is successful
68+
- vpn_gateway is not changed
69+
- vpn_gateway.vpc == cs_resource_prefix + "_vpc"
70+
71+
- name: test remove vpn gateway in check mode
72+
ngine_io.cloudstack.vpn_gateway:
73+
vpc: "{{ cs_resource_prefix }}_vpc"
74+
zone: "{{ cs_common_zone_adv }}"
75+
state: absent
76+
register: vpn_gateway
77+
check_mode: true
78+
- name: verify test remove vpn gateway in check mode
79+
assert:
80+
that:
81+
- vpn_gateway is successful
82+
- vpn_gateway is changed
83+
- vpn_gateway.vpc == cs_resource_prefix + "_vpc"
84+
85+
- name: test remove vpn gateway
86+
ngine_io.cloudstack.vpn_gateway:
87+
vpc: "{{ cs_resource_prefix }}_vpc"
88+
zone: "{{ cs_common_zone_adv }}"
89+
state: absent
90+
register: vpn_gateway
91+
- name: verify test remove vpn gateway
92+
assert:
93+
that:
94+
- vpn_gateway is successful
95+
- vpn_gateway is changed
96+
- vpn_gateway.vpc == cs_resource_prefix + "_vpc"
97+
98+
- name: test remove vpn gateway idempotence
99+
ngine_io.cloudstack.vpn_gateway:
100+
vpc: "{{ cs_resource_prefix }}_vpc"
101+
zone: "{{ cs_common_zone_adv }}"
102+
state: absent
103+
register: vpn_gateway
104+
- name: verify test remove vpn gateway idempotence
105+
assert:
106+
that:
107+
- vpn_gateway is successful
108+
- vpn_gateway is not changed

0 commit comments

Comments
 (0)