blob: dee472b01099994e884a43a0ed3daa40388a75af [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 }
Oleh Hryhorov404e9572020-01-21 18:57:22 +020052 $node_metadata: { get_param: metadata }
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020053
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010054 server:
55 type: OS::Nova::Server
56 properties:
57 image: { get_param: image }
58 flavor: { get_param: flavor }
59 key_name: { get_param: key_name }
60 availability_zone: nova
61 networks:
62 - port: { get_resource: server_port }
63 - network: { get_param: private_floating_network }
64 user_data_format: RAW
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020065 user_data: { get_resource: software_config }
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010066 metadata: { get_param: metadata }
67
68 server_port:
69 type: OS::Neutron::Port
70 properties:
71 network_id: { get_param: private_net_id }
72 port_security_enabled: false
73 fixed_ips:
74 - subnet: { get_param: private_subnet_id }
75
76 server_floating_ip:
77 type: OS::Neutron::FloatingIP
78 properties:
79 floating_network_id: { get_param: public_net_id }
80 port_id: { get_resource: server_port }
81
Vasyl Saienko3ab29c92020-01-03 10:39:03 +020082 wait_handle:
83 type: OS::Heat::WaitConditionHandle
84 wait_condition:
85 type: OS::Heat::WaitCondition
86 properties:
87 handle: { get_resource: wait_handle }
88 timeout: { get_param: boot_timeout }
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010089
90outputs:
91 server_private_ip:
92 description: IP address of server in private network
93 value: { get_attr: [ server_port, fixed_ips, 0, ip_address] }
Oleh Hryhorov404e9572020-01-21 18:57:22 +020094 server_private_floating_ip:
95 description: IP address of server in private floating network
96 value: { get_attr: [server, networks, { get_param: private_floating_network }, 0]}
Gerrit MCPbbf9d5d2019-12-19 13:47:41 +010097 server_public_ip:
98 description: Floating IP address of server in public network
99 value: { get_attr: [ server_floating_ip, floating_ip_address ] }