blob: 7cb89aeb1138b3eaa904047f00a90a70dc77246c [file] [log] [blame]
Oleh Hryhorovb58460e2020-02-05 15:53:48 +02001heat_template_version: queens
2
3parameters:
4
5 metadata:
6 type: json
7 default: {}
8 node_type:
9 type: string
10 key_name:
11 type: string
12 description: Name of keypair to assign to servers
13 image:
14 type: string
15 description: Name of image to use for servers
16 flavor:
17 type: string
18 description: Flavor to use for servers
19 accessible_network:
20 type: string
21 accessible_subnet_id:
22 type: string
23 private_floating_network:
24 type: string
25 private_floating_network_cidr:
26 type: string
27 private_floating_subnet_id:
28 type: string
29 private_floating_interface:
30 type: string
31 host_interface:
32 type: string
33 functions_override:
34 type: string
35 boot_timeout:
36 type: number
37 description: Boot timeout for instance
38 default: 1200
39 ucp_master_host:
40 type: string
41 default: ''
42 public_net_id:
43 type: string
44
45resources:
46
47 software_config:
48 type: OS::Heat::SoftwareConfig
49 properties:
50 group: ungrouped
51 config:
52 str_replace:
53 template: { get_file: ../scripts/instance_boot.sh }
54 params:
55 $node_type: { get_param: node_type }
56 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
57 $ucp_license_key: { get_file: ../scripts/license.lic }
58 $ucp_master_host: { get_param: ucp_master_host }
59 $node_metadata: { get_param: metadata }
60 $host_interface: { get_param: host_interface }
61 $private_floating_interface: { get_param: private_floating_interface }
62 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
63 $private_floating_network_cidr: { str_split: ['/', { get_param: private_floating_network_cidr }, 1] }
64 $functions_override: { get_param: functions_override }
65
66 server:
67 type: OS::Nova::Server
68 properties:
69 image: { get_param: image }
70 flavor: { get_param: flavor }
71 key_name: { get_param: key_name }
72 availability_zone: nova
73 networks:
74 - port: { get_resource: accessible_server_port }
75 - port: { get_resource: private_floating_server_port }
76 user_data_format: RAW
77 user_data: { get_resource: software_config }
78 metadata: { get_param: metadata }
79
80 accessible_server_port:
81 type: OS::Neutron::Port
82 properties:
83 network_id: { get_param: accessible_network }
84 port_security_enabled: false
85 fixed_ips:
86 - subnet: { get_param: accessible_subnet_id }
87
88 private_floating_server_port:
89 type: OS::Neutron::Port
90 properties:
91 network_id: { get_param: private_floating_network }
92 port_security_enabled: false
93 fixed_ips:
94 - subnet: { get_param: private_floating_subnet_id }
95
96 server_floating_ip:
97 type: OS::Neutron::FloatingIP
98 properties:
99 floating_network_id: { get_param: public_net_id }
100 port_id: { get_resource: accessible_server_port }
101
102 wait_handle:
103 type: OS::Heat::WaitConditionHandle
104 wait_condition:
105 type: OS::Heat::WaitCondition
106 properties:
107 handle: { get_resource: wait_handle }
108 timeout: { get_param: boot_timeout }
109
110outputs:
111 server_private_ip:
112 description: IP address of server in private network
113 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
114 server_private_floating_ip:
115 description: IP address of server in private floating network
116 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
117 server_public_ip:
118 description: Floating IP address of server in public network
119 value: { get_attr: [ server_floating_ip, floating_ip_address ] }