vFW and vDNS support added to azure-plugin
[multicloud/azure.git] / azure / aria / aria-extension-cloudify / examples / openstack-hello-world / openstack-helloworld.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 imports:
4   - https://raw.githubusercontent.com/cloudify-cosmo/aria-extension-cloudify/master/plugins/openstack/plugin.yaml
5   - aria-1.0
6
7 node_types:
8   web_app:
9     derived_from: tosca.nodes.WebApplication
10     properties:
11       port:
12         type: integer
13         default:
14
15 topology_template:
16
17   inputs:
18     ssh_username:
19       type: string
20       default: ubuntu
21     external_network_name:
22       type: string
23     webserver_port:
24       type: integer
25     private_key_path:
26       type: string
27     image:
28       type: string
29     flavor:
30       type: string
31     openstack_config:
32       type: map
33       entry_schema: string
34
35   node_templates:
36     network:
37       type: aria.openstack.nodes.Network
38       properties:
39         resource_id: aria_helloworld_network
40         create_if_missing: true
41         openstack_config: { get_input: openstack_config }
42
43     router:
44       type: aria.openstack.nodes.Router
45       properties:
46         external_network: { get_input: external_network_name }
47         create_if_missing: true
48         resource_id: aria_helloworld_rtr
49         openstack_config: { get_input: openstack_config }
50
51     subnet:
52       type: aria.openstack.nodes.Subnet
53       properties:
54         resource_id: aria_helloworld_subnet
55         create_if_missing: true
56         openstack_config: { get_input: openstack_config }
57       requirements:
58         - router: router
59         - network: network
60
61     port:
62       type: aria.openstack.nodes.Port
63       properties:
64         create_if_missing: true
65         resource_id: aria_helloworld_port
66         openstack_config: { get_input: openstack_config }
67       requirements:
68         - security_group: security_group
69         - subnet: subnet
70         - network: network
71
72     virtual_ip:
73       type: aria.openstack.nodes.FloatingIP
74       properties:
75         resource_id: aria_helloworld_floatingip
76         create_if_missing: true
77         openstack_config: { get_input: openstack_config }
78         floatingip:
79           floating_network_name: { get_input: external_network_name }
80
81     security_group:
82       type: aria.openstack.nodes.SecurityGroup
83       properties:
84         create_if_missing: true
85         resource_id: aria_helloworld_sg
86         openstack_config: { get_input: openstack_config }
87         rules:
88           - remote_ip_prefix: 0.0.0.0/0
89             port: { get_input: webserver_port }
90           - port: 22
91             remote_ip_prefix: 0.0.0.0/0
92
93     keypair:
94       type: aria.openstack.nodes.KeyPair
95       properties:
96         create_if_missing: true
97         resource_id: aria_helloworld_kp
98         private_key_path: { get_input: private_key_path }
99         openstack_config: { get_input: openstack_config }
100
101     vm:
102       type: aria.openstack.nodes.Server
103       properties:
104         image: { get_input: image }
105         flavor: { get_input: flavor }
106         create_if_missing: true
107         resource_id: aria_helloworld_vm
108         management_network_name: aria_helloworld_network
109         openstack_config: { get_input: openstack_config }
110       requirements:
111         - floating_ip: virtual_ip
112         - security_group: security_group
113         - key_pair: keypair
114         - port: port
115
116     web_app:
117       type: web_app
118       properties:
119         port: { get_input: webserver_port }
120       requirements:
121         - host: vm
122       interfaces:
123         Standard:
124           configure:
125             implementation:
126               primary: scripts/configure.sh
127               dependencies:
128                 - "ssh.user > { get_input: ssh_username }"
129                 - "ssh.key_filename > { get_input: private_key_path }"
130                 - "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"
131           start:
132             implementation:
133               primary: scripts/start.sh
134               dependencies:
135                 - "ssh.user > { get_input: ssh_username }"
136                 - "ssh.key_filename > { get_input: private_key_path }"
137                 - "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"
138           stop:
139             implementation:
140               primary: scripts/stop.sh
141               dependencies:
142                 - "ssh.user > { get_input: ssh_username }"
143                 - "ssh.key_filename > { get_input: private_key_path }"
144                 - "ssh.address > { get_attribute: [ virtual_ip, floating_ip_address ] }"