forked from congto/OpenStack-Lab-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnet-heat-stack.yaml
87 lines (77 loc) · 2.28 KB
/
net-heat-stack.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
heat_template_version: 2015-10-15
description: Template to deploy an instance with floating IP on the external network
parameters:
image:
type: string
label: Image name or ID
description: Image to be used for compute instance
constraints:
- allowed_values: [cirros, centos, ubuntu]
default: cirros
flavor:
type: string
label: Flavor
description: Type of flavor to be used
constraints:
- allowed_values: [small, medium, large]
default: small
key:
type: string
label: Key name
description: Name of key-pair to be used for compute instance
default: demokey
public_network:
type: string
label: Public network name or ID
description: Public network with floating IP addresses.
default: provider-network
resources:
private_network:
type: OS::Neutron::Net
private_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: private_network }
cidr: 192.168.100.0/24
dns_nameservers:
- 8.8.8.8
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: public_network }
router-interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: private_subnet }
floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: public_network }
my_instance:
type: OS::Nova::Server
properties:
image: { get_param: image }
key_name: { get_param: key }
flavor: { get_param: flavor }
networks:
- network: { get_resource: private_network }
floating_ip_assoc:
type: OS::Nova::FloatingIPAssociation
properties:
floating_ip: { get_resource: floating_ip }
server_id: { get_resource: my_instance }
outputs:
instance_name:
description: Name of the instance
value: { get_attr: [my_instance, name] }
instance_ip:
description: IP address of the instance
value: { get_attr: [my_instance, first_address] }
floating_ip:
description: Floating IP address assigned to the instance
value: { get_attr: [floating_ip, floating_ip_address] }
private_network:
description: Private network name assigned to the instance
value: { get_attr: [private_network, name] }