blob: a2cf684c2e9c4a55dd959ff118537d937cc03ba1 [file] [log] [blame]
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +01001heat_template_version: queens
2
3parameters:
4 key_name:
5 type: string
6 description: Name of keypair to assign to servers
7 image:
8 type: string
9 description: Name of image to use for servers
10 flavor:
11 type: string
12 description: Flavor to use for servers
13 public_net_id:
14 type: string
15 description: >
16 ID of public network for which floating IP addresses will be allocated
17 private_net_id:
18 type: string
19 description: ID of private network into which servers get deployed
20 private_subnet_id:
21 type: string
22 description: ID of private subnet
23 private_floating_network:
24 type: string
25 description: ID of network that will be used for floating in nested openstack
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020026 boot_timeout:
27 type: number
28 description: Boot timeout for instance
29 default: 1200
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010030 metadata:
31 type: json
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020032 node_type:
33 type: string
34 ucp_master_host:
35 type: string
36 default: ''
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010037
38resources:
39
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020040 software_config:
41 type: OS::Heat::SoftwareConfig
42 properties:
43 group: ungrouped
44 config:
45 str_replace:
46 template: { get_file: ./scripts/instance_boot.sh }
47 params:
48 $node_type: { get_param: node_type }
49 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
50 $ucp_license_key: { get_file: ./scripts/license.lic }
51 $ucp_master_host: { get_param: ucp_master_host }
52
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010053 server:
54 type: OS::Nova::Server
55 properties:
56 image: { get_param: image }
57 flavor: { get_param: flavor }
58 key_name: { get_param: key_name }
59 availability_zone: nova
60 networks:
61 - port: { get_resource: server_port }
62 - network: { get_param: private_floating_network }
63 user_data_format: RAW
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020064 user_data: { get_resource: software_config }
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010065 metadata: { get_param: metadata }
66
67 server_port:
68 type: OS::Neutron::Port
69 properties:
70 network_id: { get_param: private_net_id }
71 port_security_enabled: false
72 fixed_ips:
73 - subnet: { get_param: private_subnet_id }
74
75 server_floating_ip:
76 type: OS::Neutron::FloatingIP
77 properties:
78 floating_network_id: { get_param: public_net_id }
79 port_id: { get_resource: server_port }
80
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020081 wait_handle:
82 type: OS::Heat::WaitConditionHandle
83 wait_condition:
84 type: OS::Heat::WaitCondition
85 properties:
86 handle: { get_resource: wait_handle }
87 timeout: { get_param: boot_timeout }
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010088
89outputs:
90 server_private_ip:
91 description: IP address of server in private network
92 value: { get_attr: [ server_port, fixed_ips, 0, ip_address] }
93 server_public_ip:
94 description: Floating IP address of server in public network
95 value: { get_attr: [ server_floating_ip, floating_ip_address ] }