-
Notifications
You must be signed in to change notification settings - Fork 7
/
openstack-example-network.yaml~
169 lines (129 loc) · 4.32 KB
/
openstack-example-network.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
tosca_definitions_version: cloudify_dsl_1_3
description: >
Create an Example Openstack Network.
imports:
- https://cloudify.co/spec/cloudify/5.1.0/types.yaml
- plugin:cloudify-openstack-plugin?version= >=3.0.0
inputs:
username:
description: OS_USERNAME as specified in Openstack RC file.
default: { get_secret: keystone_username }
password:
description: Openstack user password.
default: { get_secret: keystone_password }
tenant_name:
description: OS_TENANT_NAME as specified in Openstack RC file.
default: { get_secret: keystone_tenant_name }
auth_url:
description: OS_AUTH_URL as specified in Openstack RC file.
default: { get_secret: keystone_url }
region:
description: OS_REGION_NAME as specified in Openstack RC file.
default: { get_secret: keystone_region }
external_network_name:
description: Openstack tenant external network name.
default: { get_secret: external_network }
nameservers:
default: [8.8.4.4, 8.8.8.8]
public_subnet_cidr:
default: 10.10.0.0/24
public_subnet_allocation_pools:
default:
- start: 10.10.0.2
end: 10.10.0.254
private_subnet_cidr:
default: 10.10.1.0/24
private_subnet_allocation_pools:
default:
- start: 10.10.1.2
end: 10.10.1.254
user_domain_name:
default: default
project_domain_name:
default: default
dsl_definitions:
client_config: &client_config
username: { get_input: username }
password: { get_input: password }
tenant_name: { get_input: tenant_name }
auth_url: { get_input: auth_url }
region_name: { get_input: region }
user_domain_name: { get_input: user_domain_name }
project_domain_name: { get_input: project_domain_name }
node_templates:
external_network:
type: cloudify.nodes.openstack.Network
properties:
client_config: *client_config
use_external_resource: true
resource_config:
id: { get_input: external_network_name }
public_network:
type: cloudify.nodes.openstack.Network
properties:
client_config: *client_config
private_network:
type: cloudify.nodes.openstack.Network
properties:
client_config: *client_config
public_network_router:
type: cloudify.nodes.openstack.Router
properties:
client_config: *client_config
relationships:
- type: cloudify.relationships.connected_to
target: external_network
public_subnet:
type: cloudify.nodes.openstack.Subnet
properties:
client_config: *client_config
resource_config:
ip_version: 4
cidr: { get_input: public_subnet_cidr }
dns_nameservers: { get_input: nameservers }
allocation_pools: { get_input: public_subnet_allocation_pools }
relationships:
- type: cloudify.relationships.contained_in
target: public_network
- type: cloudify.relationships.openstack.subnet_connected_to_router
target: public_network_router
private_subnet:
type: cloudify.nodes.openstack.Subnet
properties:
client_config: *client_config
resource_config:
ip_version: 4
cidr: { get_input: private_subnet_cidr }
dns_nameservers: { get_input: nameservers }
allocation_pools: { get_input: private_subnet_allocation_pools }
relationships:
- type: cloudify.relationships.contained_in
target: private_network
- type: cloudify.relationships.openstack.subnet_connected_to_router
target: public_network_router
outputs:
external_network:
value: { get_attribute: [ external_network, id ] }
public_network_router:
value: { get_attribute: [ public_network_router, id ] }
public_network:
value: { get_attribute: [ public_network, id ] }
private_network:
value: { get_attribute: [ private_network, id ] }
public_subnet:
value: { get_attribute: [ public_subnet, id ] }
private_subnet:
value: { get_attribute: [ private_subnet, id ] }
capabilities:
external_network:
value: { get_attribute: [ external_network, id ] }
public_network_router:
value: { get_attribute: [ public_network_router, id ] }
public_network:
value: { get_attribute: [ public_network, id ] }
private_network:
value: { get_attribute: [ private_network, id ] }
public_subnet:
value: { get_attribute: [ public_subnet, id ] }
private_subnet:
value: { get_attribute: [ private_subnet, id ] }