-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovisioning.yaml
177 lines (154 loc) · 5.11 KB
/
provisioning.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/4.4/types.yaml
- plugin:cloudify-openstack-plugin?version=2.14.7
inputs:
security_group_name:
type: string
default: opencontrail_sg
description: security group name to use
left_network_name:
type: string
default: left_net
description: left side (LAN/branch) network name to set
left_network_subnet_name:
type: string
default: left_subnet
description: left side (LAN/branch) subnet name to set
left_subnet_cidr:
type: string
default: 10.10.1.0/24
description: left side (LAN/branch) network CIDR in format of x.x.x.x/y
right_network_name:
type: string
default: right_net
description: right side (WAN/internet) network name to set
right_network_subnet_name:
type: string
default: right_subnet
description: right side (WAN/internet) subnet name to set
right_subnet_cidr:
type: string
default: 10.10.2.0/24
description: right side (WAN/internet) network CIDR in format of x.x.x.x/y
image:
type: string
default: cirros-0.4.0-x86_64
description: VM image for the service instance
flavor:
type: string
default: tiny
description: openstack flavor name to use for the VM instance
dsl_definitions:
openstack_config: &openstack_config
username: { get_secret: opencontrail_keystone_username }
password: { get_secret: opencontrail_keystone_password }
tenant_name: { get_secret: opencontrail_keystone_tenant_name }
auth_url: { get_secret: opencontrail_keystone_url }
region: { get_secret: opencontrail_keystone_region }
node_templates:
left_vm:
type: cloudify.openstack.nodes.Server
properties:
image: { get_input: image }
flavor: { get_input: flavor }
install_agent: false
openstack_config: *openstack_config
relationships:
- target: security_group
type: cloudify.openstack.server_connected_to_security_group
- target: left_port
type: cloudify.relationships.connected_to
right_vm:
type: cloudify.openstack.nodes.Server
properties:
image: { get_input: image }
flavor: { get_input: flavor }
install_agent: false
openstack_config: *openstack_config
relationships:
- target: security_group
type: cloudify.openstack.server_connected_to_security_group
- target: right_port
type: cloudify.relationships.connected_to
left_network:
type: cloudify.openstack.nodes.Network
properties:
openstack_config: *openstack_config
resource_id: { get_input: left_network_name }
use_external_resource : false
left_subnet:
type: cloudify.openstack.nodes.Subnet
properties:
openstack_config: *openstack_config
resource_id: { get_input: left_network_subnet_name }
use_external_resource : false
subnet:
ip_version: 4
cidr: { get_input: left_subnet_cidr }
relationships:
- target: left_network
type: cloudify.relationships.contained_in
left_port:
type: cloudify.openstack.nodes.Port
properties:
openstack_config: *openstack_config
relationships:
- type: cloudify.relationships.contained_in
target: left_network
- type: cloudify.relationships.depends_on
target: left_subnet
- target: security_group
type: cloudify.openstack.port_connected_to_security_group
right_network:
type: cloudify.openstack.nodes.Network
properties:
openstack_config: *openstack_config
resource_id: { get_input: right_network_name }
use_external_resource : false
right_subnet:
type: cloudify.openstack.nodes.Subnet
properties:
openstack_config: *openstack_config
resource_id: { get_input: right_network_subnet_name }
use_external_resource : false
subnet:
ip_version: 4
cidr: { get_input: right_subnet_cidr }
relationships:
- target: right_network
type: cloudify.relationships.contained_in
right_port:
type: cloudify.openstack.nodes.Port
properties:
openstack_config: *openstack_config
relationships:
- type: cloudify.relationships.contained_in
target: right_network
- type: cloudify.relationships.depends_on
target: right_subnet
- target: security_group
type: cloudify.openstack.port_connected_to_security_group
# security
security_group:
type: cloudify.openstack.nodes.SecurityGroup
properties:
openstack_config: *openstack_config
use_external_resource: false
resource_id: { get_input: security_group_name }
security_group:
name: { get_input: security_group_name }
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
- protocol: icmp
port_range_min: 0
port_range_max: 255
remote_ip_prefix: 0.0.0.0/0
capabilities:
left_network_name:
description: Name of created left network
value: { get_attribute: [right_network, external_name] }
right_network_name:
description: Name of created right network
value: { get_attribute: [left_network, external_name] }