blob: 1fb031c71c3efbd7c0f6437a521a379258fb58c5 (
plain)
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
|
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- https://raw.githubusercontent.com/cloudify-cosmo/aria-extension-cloudify/master/plugins/openstack/plugin.yaml
- aria-1.0
node_types:
web_app:
derived_from: tosca.nodes.WebApplication
properties:
port:
type: integer
default:
topology_template:
inputs:
ssh_username:
type: string
default: ubuntu
external_network_name:
type: string
webserver_port:
type: integer
private_key_path:
type: string
image:
type: string
flavor:
type: string
openstack_config:
type: map
entry_schema: string
node_templates:
network:
type: aria.openstack.nodes.Network
properties:
resource_id: aria_helloworld_network
create_if_missing: true
openstack_config: { get_input: openstack_config }
router:
type: aria.openstack.nodes.Router
properties:
external_network: { get_input: external_network_name }
create_if_missing: true
resource_id: aria_helloworld_rtr
openstack_config: { get_input: openstack_config }
subnet:
type: aria.openstack.nodes.Subnet
properties:
resource_id: aria_helloworld_subnet
create_if_missing: true
openstack_config: { get_input: openstack_config }
requirements:
- router: router
- network: network
port:
type: aria.openstack.nodes.Port
properties:
create_if_missing: true
resource_id: aria_helloworld_port
openstack_config: { get_input: openstack_config }
requirements:
- security_group: security_group
- subnet: subnet
- network: network
virtual_ip:
type: aria.openstack.nodes.FloatingIP
properties:
resource_id: aria_helloworld_floatingip
create_if_missing: true
openstack_config: { get_input: openstack_config }
floatingip:
floating_network_name: { get_input: external_network_name }
security_group:
type: aria.openstack.nodes.SecurityGroup
properties:
create_if_missing: true
resource_id: aria_helloworld_sg
openstack_config: { get_input: openstack_config }
rules:
- remote_ip_prefix: 0.0.0.0/0
port: { get_input: webserver_port }
- port: 22
remote_ip_prefix: 0.0.0.0/0
keypair:
type: aria.openstack.nodes.KeyPair
properties:
create_if_missing: true
resource_id: aria_helloworld_kp
private_key_path: { get_input: private_key_path }
openstack_config: { get_input: openstack_config }
vm:
type: aria.openstack.nodes.Server
properties:
image: { get_input: image }
flavor: { get_input: flavor }
create_if_missing: true
resource_id: aria_helloworld_vm
management_network_name: aria_helloworld_network
openstack_config: { get_input: openstack_config }
requirements:
- floating_ip: virtual_ip
- security_group: security_group
- key_pair: keypair
- port: port
web_app:
type: web_app
properties:
port: { get_input: webserver_port }
requirements:
- host: vm
interfaces:
Standard:
configure:
implementation:
primary: scripts/configure.sh
dependencies:
- "ssh.user > { get_input: ssh_username }"
- "ssh.key_filename > { get_input: private_key_path }"
- "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"
start:
implementation:
primary: scripts/start.sh
dependencies:
- "ssh.user > { get_input: ssh_username }"
- "ssh.key_filename > { get_input: private_key_path }"
- "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"
stop:
implementation:
primary: scripts/stop.sh
dependencies:
- "ssh.user > { get_input: ssh_username }"
- "ssh.key_filename > { get_input: private_key_path }"
- "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"
|