Skip to content

Commit 4d2698d

Browse files
Update scenario45_dms_inst.yaml vpc role (#105)
Update scenario45_dms_inst.yaml vpc role using role instead of module Reviewed-by: Vladimir Hasko <[email protected]>
1 parent 8174069 commit 4d2698d

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

playbooks/scenario45_dms_inst.yaml

+22-29
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
- set_fact:
1414
test_security_group_name: "{{ (prefix + '-sg') }}"
15-
test_vpc_name: "{{ ( prefix + '-vpc') }}"
16-
test_subnet_name: "{{ ( prefix + '-subnet') }}"
1715
dms_inst_name: "{{ (prefix + '-dms_apimon') }}"
1816
dms_spec: dms.instance.kafka.cluster.c3.mini
19-
17+
test_router_name: "{{ (prefix + '-test_router_apimon') }}"
18+
test_network_name: "{{ (prefix + '-test_network_apimon') }}"
19+
test_subnet_name: "{{ (prefix + '-test_subnet_apimon') }}"
20+
2021
- block:
2122
- name: List DMS az
2223
script: "list_dms_az.py"
@@ -33,22 +34,16 @@
3334
args:
3435
executable: python3
3536
register: spec
36-
37-
- name: Create VPC
38-
opentelekomcloud.cloud.vpc:
39-
name: "{{ test_vpc_name }}"
40-
cidr: "10.10.0.0/24"
37+
38+
- name: Create VPC (Router + Net + Subnet)
39+
import_role:
40+
name: opentelekomcloud.vpc
41+
vars:
42+
router_name: "{{ test_router_name }}"
43+
network_name: "{{ test_network_name }}"
44+
subnet_name: "{{ test_subnet_name }}"
4145
state: present
42-
register: newvpc
43-
44-
- name: Create subnet for VPC
45-
opentelekomcloud.cloud.subnet:
46-
name: "{{ test_subnet_name }}"
47-
vpc_id: "{{ newvpc.vpc.id }}"
48-
cidr: "10.10.0.0/27"
49-
gateway_ip: "10.10.0.1"
50-
register: sn
51-
46+
5247
- name: Create SG
5348
openstack.cloud.security_group:
5449
name: "{{ test_security_group_name }}"
@@ -59,9 +54,9 @@
5954
opentelekomcloud.cloud.dms_instance:
6055
name: "{{ dms_inst_name }}"
6156
storage_space: "{{ spec.stdout_lines[0] }}"
62-
vpc_id: "{{ newvpc.vpc.id }}"
57+
vpc_id: "{{ net_router.router.id }}"
6358
security_group_id: "{{ newsg.security_group.id }}"
64-
subnet_id: "{{ sn.subnet.id }}"
59+
subnet_id: "{{ net_network.network.id }}"
6560
available_zones: [ "{{ az_id }}" ]
6661
product_id: "{{ spec.stdout_lines[1] }}"
6762
storage_spec_code: "{{ spec.stdout_lines[2] }}"
@@ -98,15 +93,13 @@
9893
name: "{{ test_security_group_name }}"
9994
state: absent
10095

101-
- name: Delete Subnet
102-
opentelekomcloud.cloud.subnet:
103-
name: "{{ test_subnet_name }}"
104-
vpc_id: "{{ newvpc.vpc.id }}"
105-
state: absent
106-
107-
- name: Delete vpc
108-
opentelekomcloud.cloud.vpc:
109-
name: "{{ test_vpc_name }}"
96+
- name: Delete VPC (Router + Net + Subnet)
97+
import_role:
98+
name: opentelekomcloud.vpc
99+
vars:
110100
state: absent
101+
router_name: "{{ test_router_name }}"
102+
network_name: "{{ test_network_name }}"
103+
subnet_name: "{{ test_subnet_name }}"
111104

112105
ignore_errors: true

0 commit comments

Comments
 (0)