blob: db06a9536345ac0a67e121bdef83f2dfe786f168 [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
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020044 docker_ee_release:
45 type: string
46 docker_ee_url:
47 type: string
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020048
49resources:
50
51 software_config:
52 type: OS::Heat::SoftwareConfig
53 properties:
54 group: ungrouped
55 config:
56 str_replace:
57 template: { get_file: ../scripts/instance_boot.sh }
58 params:
59 $node_type: { get_param: node_type }
60 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
61 $ucp_license_key: { get_file: ../scripts/license.lic }
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020062 $docker_ee_url: { get_param: docker_ee_url }
63 $docker_ee_release: { get_param: docker_ee_release }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020064 $ucp_master_host: { get_param: ucp_master_host }
65 $node_metadata: { get_param: metadata }
66 $host_interface: { get_param: host_interface }
67 $private_floating_interface: { get_param: private_floating_interface }
68 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
69 $private_floating_network_cidr: { str_split: ['/', { get_param: private_floating_network_cidr }, 1] }
70 $functions_override: { get_param: functions_override }
71
72 server:
73 type: OS::Nova::Server
74 properties:
75 image: { get_param: image }
76 flavor: { get_param: flavor }
77 key_name: { get_param: key_name }
78 availability_zone: nova
79 networks:
80 - port: { get_resource: accessible_server_port }
81 - port: { get_resource: private_floating_server_port }
82 user_data_format: RAW
83 user_data: { get_resource: software_config }
84 metadata: { get_param: metadata }
85
86 accessible_server_port:
87 type: OS::Neutron::Port
88 properties:
89 network_id: { get_param: accessible_network }
90 port_security_enabled: false
91 fixed_ips:
92 - subnet: { get_param: accessible_subnet_id }
93
94 private_floating_server_port:
95 type: OS::Neutron::Port
96 properties:
97 network_id: { get_param: private_floating_network }
98 port_security_enabled: false
99 fixed_ips:
100 - subnet: { get_param: private_floating_subnet_id }
101
102 server_floating_ip:
103 type: OS::Neutron::FloatingIP
104 properties:
105 floating_network_id: { get_param: public_net_id }
106 port_id: { get_resource: accessible_server_port }
107
108 wait_handle:
109 type: OS::Heat::WaitConditionHandle
110 wait_condition:
111 type: OS::Heat::WaitCondition
112 properties:
113 handle: { get_resource: wait_handle }
114 timeout: { get_param: boot_timeout }
115
116outputs:
117 server_private_ip:
118 description: IP address of server in private network
119 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
120 server_private_floating_ip:
121 description: IP address of server in private floating network
122 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
123 server_public_ip:
124 description: Floating IP address of server in public network
125 value: { get_attr: [ server_floating_ip, floating_ip_address ] }