-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflex_easy_server.yaml
98 lines (87 loc) · 2.59 KB
/
flex_easy_server.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
heat_template_version: 2021-04-16
description: >
Basic OpenStack environment with a private network, router, security group, and instance(s).
parameters:
public_net:
type: string
default: PUBLICNET
description: The pre-existing public network for external access.
image:
type: string
description: The OS for the instance. ie Ubuntu-24.04.
flavor:
type: string
description: The flavor to use for instances. ie gp.0.2.2.
instance_count:
type: number
default: 1
description: Number of instances to create.
key_name:
type: string
description: Name of an existing SSH keypair to use for instances.
resources:
private_net:
type: OS::Neutron::Net
properties:
name: private_net
private_subnet:
type: OS::Neutron::Subnet
properties:
name: private_subnet
network_id: { get_resource: private_net }
cidr: 192.168.1.0/24
gateway_ip: 192.168.1.1
dns_nameservers:
- 8.8.8.8
- 8.8.4.4
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: public_net }
router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: private_subnet }
security_group:
type: OS::Neutron::SecurityGroup
properties:
name: default_security_group
rules:
- protocol: icmp
- protocol: tcp
port_range_min: 22
port_range_max: 22
instances:
type: OS::Heat::ResourceGroup
properties:
count: { get_param: instance_count }
resource_def:
type: OS::Nova::Server
properties:
name: instance-%index%
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- network: { get_resource: private_net }
security_groups:
- { get_resource: security_group }
floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: public_net }
floating_ip_association:
type: OS::Neutron::FloatingIPAssociation
properties:
floatingip_id: { get_resource: floating_ip }
port_id:
get_attr: [instances, resource.0, addresses, private_net, 0, port]
outputs:
instance_ips:
description: The private IPs of the instances.
value: { get_attr: [instances, resource.0, addresses, private_net, 0, addr] }
floating_ip:
description: The floating IP assigned to the first instance.
value: { get_attr: [floating_ip, floating_ip_address] }