This repository was archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance.yaml
More file actions
85 lines (78 loc) · 2.14 KB
/
instance.yaml
File metadata and controls
85 lines (78 loc) · 2.14 KB
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
heat_template_version: queens
description: >
Heat template to create an instance with a list of network
to connect to and a floating IP for management.
################## PARAMETERS ##################
parameters:
image:
type: string
description: Instance image name
hostname:
type: string
description: Hostname of the instance
net_id_list:
type: comma_delimited_list
description: networks CIDR to connect to FGT
config:
type: string
description: Custom config for the instance
mgmt_net:
type: string
description: My private network
default: "mgmt"
public_net:
type: string
description: External network for floating IPs
default: "public"
flavor:
type: string
description: Flavor of the VMs
default: "m1.small"
keyname:
type: string
description: Keypair to upload to server
default: "default"
################## RESOURCES ##################
resources:
mgmt_port:
type: OS::Neutron::Port
properties:
network: { get_param: mgmt_net }
security_groups: []
port_security_enabled: false
# FLOATING IP
# floating_ip:
# type: OS::Neutron::FloatingIP
# depends_on: mgmt_port
# properties:
# floating_network: { get_param: public_net }
# port_id: { get_resource: mgmt_port }
# INSTANCE
instance:
type: OS::Nova::Server
depends_on: mgmt_port
properties:
name: { get_param: hostname }
image: { get_param: image }
flavor: { get_param: flavor }
user_data_format: RAW
user_data: { get_param: config }
config_drive: True
key_name: { get_param: keyname }
security_groups: [] # no security group
networks:
list_concat:
- [ port: { get_resource: mgmt_port } ]
- repeat:
template:
network: <%net_id%>
for_each:
<%net_id%>: { get_param: net_id_list }
################## OUTPUTS ##################
outputs:
Hostname:
value: { get_attr: [instance, name] }
addresses:
value: { get_attr: [instance, addresses] }
# FloatingIP:
# value: { get_attr: [floating_ip, floating_ip_address] }