blob: 4381a6eb480182d7f32f8c50c957f7c74f33c308 [file] [log] [blame]
Hong Guan62f78a62017-11-21 11:00:42 -05001###########################################################
2# This Blueprint installs ONAP SO on Openstack
3###########################################################
4
5tosca_definitions_version: cloudify_dsl_1_3
6
7description: >
8 This blueprint creates a ONAP service orchestrator
9
10imports:
11 - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml
12 - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml
13 - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml
14 - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml
15
16inputs:
17 nexus_repo:
18 type: string
19 default: https://nexus.onap.org/content/sites/raw
20
21 docker_repo:
22 type: string
23 default: nexus3.onap.org:10001
24
25 nexus_username:
26 type: string
27 default: docker
28
29 nexus_password:
30 type: string
31 default: docker
32
33 artifacts_version:
34 type: string
35 default: 1.1.0-SNAPSHOT
36
37 dns_ip:
38 type: string
39
40 cloud_env:
41 type: string
42 default: openstack
43
44 docker_version:
45 type: string
46 default: v1.1.1
47
48 gerrit_branch:
49 type: string
50 default: master
51
52 external_dns:
53 type: string
54
55 dmaap_topic:
56 type: string
57 default: AUTO
58
59 so_repo:
60 type: string
61 default: http://gerrit.onap.org/r/so/docker-config.git
62
63 vm_instancename:
64 type: string
65
66 image:
67 description: |
68 A Ubuntu 16.04 image, along with the usual
69 type: string
70 default: Ubuntu 16.04 LTS Generic
71
72 flavor:
73 description: >
74 A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space.
75 You might want to use 4 CPUs, 8192 MB RAM for the master.
76 type: string
77 default: m1.xlarge
78
79 ssh_user:
80 description: |
81 User for connecting to agent VM
82 type: string
83 default: ubuntu
84
85 security_group:
86 description: openstack security_group
87 type: string
88
89 keypair_name:
90 description: |
91 OpenStack keypair name
92 type: string
93
94 key_filename:
95 type: string
96
97 external_network:
98 type: string
99
100 app_subnet:
101 type: string
102
103
104 openstack_username:
105 type: string
106 description: username to authenticate to OpenStack
107
108 openstack_password:
109 type: string
110 description: OpenStack tenant password for openstack_username user
111
112 openstack_tenant_name:
113 type: string
114 description: OpenStack tenant for VM deploy
115
116 openstack_auth_url:
117 type: string
118 description: Authentication URL for OpenStack
119
120 openstack_region:
121 type: string
122 description: OpenStack region
123
124dsl_definitions:
125 openstack_credentials: &openstack_credentials
126 username: { get_input: openstack_username }
127 password: { get_input: openstack_password }
128 tenant_name: { get_input: openstack_tenant_name }
129 auth_url: { get_input: openstack_auth_url }
130 region: { get_input: openstack_region }
131
132node_templates:
133
134 key_pair:
135 type: cloudify.openstack.nodes.KeyPair
136 properties:
137 private_key_path: { get_input: key_filename }
138 use_external_resource: true
139 resource_id: { get_input: keypair_name }
140 openstack_config: *openstack_credentials
141
142 private_net:
143 type: cloudify.openstack.nodes.Network
144 properties:
145 use_external_resource: true
146 resource_id: { get_input: app_subnet }
147 openstack_config: *openstack_credentials
148
149 external_network:
150 type: cloudify.openstack.nodes.Network
151 properties:
152 openstack_config: *openstack_credentials
153 use_external_resource: true
154 resource_id: { get_input: external_network}
155
156 app_security_group:
157 type: cloudify.openstack.nodes.SecurityGroup
158 properties:
159 openstack_config: *openstack_credentials
160 use_external_resource: true
161 resource_id: { get_input: security_group }
162
163 VM_001_fixed_ip:
164 type: cloudify.openstack.nodes.Port
165 properties:
166 openstack_config: *openstack_credentials
167 relationships:
168 - type: cloudify.relationships.contained_in
169 target: private_net
170 - type: cloudify.openstack.port_connected_to_security_group
171 target: app_security_group
172
173 VM_001_floating_ip:
174 type: cloudify.openstack.nodes.FloatingIP
175 properties:
176 openstack_config: *openstack_credentials
177 interfaces:
178 cloudify.interfaces.lifecycle:
179 create:
180 inputs:
181 args:
182 floating_network_name: { get_input: external_network }
183
184 VM_001:
185 type: cloudify.openstack.nodes.Server
186 properties:
187 openstack_config: *openstack_credentials
188 install_agent: false
189 image: { get_input: image }
190 flavor: { get_input: flavor }
191 resource_id: { get_input: vm_instancename }
192 management_network_name: { get_input: app_subnet }
193 ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] }
194 relationships:
195 - type: cloudify.openstack.server_connected_to_floating_ip
196 target: VM_001_floating_ip
197 - type: cloudify.openstack.server_connected_to_keypair
198 target: key_pair
199 - type: cloudify.openstack.server_connected_to_port
200 target: VM_001_fixed_ip
201
202
203 app_001:
204 type: cloudify.nodes.SoftwareComponent
205 properties:
206 interfaces:
207 cloudify.interfaces.lifecycle:
208 start:
209 implementation: fabric.fabric_plugin.tasks.run_script
210 inputs:
211 script_path: scripts/so.sh
212 use_sudo: true
213 process:
214 args:
215 [{ get_attribute: [VM_001_floating_ip, floating_ip_address]},
216 { get_attribute: [VM_001_fixed_ip, fixed_ip_address]},
217 { get_input: nexus_repo },
218 { get_input: docker_repo},
219 { get_input: nexus_username },
220 { get_input: nexus_password },
221 { get_input: artifacts_version },
222 { get_input: dns_ip},
223 { get_input: gerrit_branch },
224 openstack,
225 { get_input: external_dns},
226 { get_input: dmaap_topic},
227 { get_input: openstack_username},
228 { get_input: openstack_tenant_name},
229 { get_input: openstack_password},
230 { get_input: openstack_region},
231 { get_input: openstack_auth_url},
232 { get_input: so_repo},
233 { get_input: docker_version }]
234 fabric_env:
235 host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]}
236 user: { get_input: ssh_user }
237 key_filename: { get_input: key_filename }
238 relationships:
239 - type: cloudify.relationships.contained_in
240 target: VM_001
241 - type: cloudify.relationships.depends_on
242 target: VM_001_floating_ip
243
244outputs:
245 ONAP_Service_Orchestrator:
246 description: informations about Service Orchestrator
247 value:
248 ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] }
249
250
251
252
253
254
255
256