-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathtest-openstack-bp.yaml
103 lines (94 loc) · 3.39 KB
/
test-openstack-bp.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
tosca_definitions_version: cloudify_dsl_1_3
description: >
The blueprint describes an OpenStack vm created using Cloudify's OpenStack plugin
and simple web server started using Cloudify's script plugin.
In addition, an OpenStack floating ip and security group are created and associated with the created vm.
imports:
- http://www.getcloudify.org/spec/cloudify/5.0.0/types.yaml
- plugin:cloudify-openstack-plugin
inputs:
webserver_port:
description: The HTTP web server port
default: 8080
agent_user:
description: User name used when SSH-ing into the started machine
image:
description: Openstack image name or id to use for the new server
flavor:
description: Openstack flavor name or id to use for the new server
network_name:
description: Openstack network name the new server will be connected to
floating_network_id:
description: The id of the network to use for allocating a floating ip
key_pair_name:
description: Openstack key pair name of the key to associate with the new server
private_key_path:
description: |
Path to the private key which will be used for connecting to the server
on the manager or machine running CLI if running in local mode.
node_templates:
virtual_ip:
type: cloudify.openstack.nodes.FloatingIP
properties:
floatingip:
floating_network_id: { get_input: floating_network_id }
interfaces:
cloudify.interfaces.validation: {}
security_group:
type: cloudify.openstack.nodes.SecurityGroup
properties:
rules:
- port: { get_property: [ http_web_server, port ] }
remote_ip_prefix: 0.0.0.0/0
- port: 22
remote_ip_prefix: 0.0.0.0/0
interfaces:
cloudify.interfaces.validation: {}
keypair:
type: cloudify.openstack.nodes.KeyPair
properties:
use_external_resource: true
resource_id: { get_input: key_pair_name }
private_key_path: { get_input: private_key_path }
interfaces:
cloudify.interfaces.validation: {}
vm:
type: cloudify.openstack.nodes.Server
properties:
agent_config:
user: { get_input: agent_user }
key: { get_property: [ keypair, private_key_path ] }
image: { get_input: image }
flavor: { get_input: flavor }
management_network_name: { get_input: network_name }
relationships:
- type: cloudify.openstack.server_connected_to_keypair
target: keypair
- type: cloudify.openstack.server_connected_to_floating_ip
target: virtual_ip
- type: cloudify.openstack.server_connected_to_security_group
target: security_group
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
args:
security_groups: [{ get_attribute: [ security_group, external_name ]}]
cloudify.interfaces.validation: {}
http_web_server:
type: cloudify.nodes.WebServer
properties:
port: { get_input: webserver_port }
relationships:
- type: cloudify.relationships.contained_in
target: vm
interfaces:
cloudify.interfaces.lifecycle:
configure: scripts/configure.sh
start: scripts/start.sh
stop: scripts/stop.sh
outputs:
http_endpoint:
description: Web server external endpoint
value: { concat: ['http://', { get_attribute: [virtual_ip, floating_ip_address] },
':', { get_property: [http_web_server, port] }] }