-
Notifications
You must be signed in to change notification settings - Fork 7
/
blueprint-osp-vm-full-dp.yaml
170 lines (144 loc) · 4.72 KB
/
blueprint-osp-vm-full-dp.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
tosca_definitions_version: cloudify_dsl_1_3
imports:
- https://cloudify.co/spec/cloudify/5.1.0/types.yaml
- plugin:cloudify-openstack-plugin?version= >=3.0.0
- plugin:cloudify-utilities-plugin
inputs:
agent_key_private:
description: >
The content of the agent's private key.
default: { get_secret: agent_key_private }
agent_key_public:
description: >
The content of the agent's public key.
default: { get_secret: agent_key_public }
agent_user:
description: >
The username of the agent running on the instance created from the image.
default: ubuntu
image:
description: >
An Openstack Image ID. Tested with a Ubuntu 14.04 image.
type: string
default: { get_secret: ubuntu_trusty_image }
flavor:
description: >
An Openstack Flavor ID.
default: '2'
manager_network:
default: external
network_deployment_name:
default: openstack-example-network
user_domain_name:
default: default
project_domain_name:
default: default
dsl_definitions:
openstack_config: &openstack_config
username: { get_secret: keystone_username }
password: { get_secret: keystone_password }
tenant_name: { get_secret: keystone_tenant_name }
auth_url: { get_secret: keystone_url }
region_name: { get_secret: keystone_region }
user_domain_name: { get_input: user_domain_name }
project_domain_name: { get_input: project_domain_name }
node_types:
nodes.MonitoredServer:
derived_from: cloudify.nodes.openstack.Server
properties:
agent_config:
default:
network: { get_input: manager_network }
install_method: init_script
user: { get_input: agent_user }
port: 22
key: { get_input: agent_key_private }
node_templates:
cloudify_host_cloud_config:
type: cloudify.nodes.CloudInit.CloudConfig
properties:
resource_config:
users:
- name: { get_input: agent_user }
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- { get_input: agent_key_public }
openstack:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: network_deployment_name }
frontend_host:
type: nodes.MonitoredServer
properties:
client_config: *openstack_config
resource_config:
image_id: { get_input: image }
flavor_id: { get_input: flavor }
user_data: { get_attribute: [ cloudify_host_cloud_config, cloud_config ] }
relationships:
- target: host_port
type: cloudify.relationships.openstack.server_connected_to_port
- type: cloudify.relationships.depends_on
target: cloudify_host_cloud_config
floating_ip:
type: cloudify.nodes.openstack.FloatingIP
properties:
client_config: *openstack_config
resource_config:
floating_network_id: { get_capability: [ { get_input: network_deployment_name }, external_network ] }
relationships:
- type: cloudify.relationships.contained_in
target: openstack
host_port:
type: cloudify.nodes.openstack.Port
properties:
client_config: *openstack_config
relationships:
- type: cloudify.relationships.contained_in
target: public_network
- type: cloudify.relationships.depends_on
target: public_subnet
- type: cloudify.relationships.openstack.port_connected_to_security_group
target: security_group
- type: cloudify.relationships.openstack.port_connected_to_floating_ip
target: floating_ip
security_group:
type: cloudify.nodes.openstack.SecurityGroup
properties:
client_config: *openstack_config
resource_config:
name: security-group
description: 'security group'
security_group_rules:
- direction: ingress
protocol: tcp
port_range_min: 22
port_range_max: 22
- direction: ingress
protocol: tcp
port_range_min: 80
port_range_max: 80
public_subnet:
type: cloudify.nodes.openstack.Subnet
properties:
client_config: *openstack_config
use_external_resource: true
resource_config:
id: { get_capability: [ { get_input: network_deployment_name }, public_subnet ] }
relationships:
- type: cloudify.relationships.contained_in
target: public_network
public_network:
type: cloudify.nodes.openstack.Network
properties:
client_config: *openstack_config
use_external_resource: true
resource_config:
id: { get_capability: [ { get_input: network_deployment_name }, public_network ] }
relationships:
- type: cloudify.relationships.contained_in
target: openstack