blob: 46f8e68db1e1905fa44ce6071d5a922f0ecd4706 [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 default: ''
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020045 docker_ee_release:
46 type: string
47 docker_ee_url:
48 type: string
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020049
50resources:
51
52 software_config:
53 type: OS::Heat::SoftwareConfig
54 properties:
55 group: ungrouped
56 config:
57 str_replace:
58 template: { get_file: ../scripts/instance_boot.sh }
59 params:
60 $node_type: { get_param: node_type }
61 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
62 $ucp_license_key: { get_file: ../scripts/license.lic }
Mykyta Karpin5ed5fd82020-01-27 18:23:29 +020063 $docker_ee_url: { get_param: docker_ee_url }
64 $docker_ee_release: { get_param: docker_ee_release }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020065 $ucp_master_host: { get_param: ucp_master_host }
66 $node_metadata: { get_param: metadata }
67 $host_interface: { get_param: host_interface }
68 $private_floating_interface: { get_param: private_floating_interface }
Oleh Hryhorovca772092020-02-13 11:15:17 +020069 $private_floating_network_cidr: { get_param: private_floating_network_cidr }
Oleh Hryhorovb58460e2020-02-05 15:53:48 +020070 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
71 $functions_override: { get_param: functions_override }
72
73 server:
74 type: OS::Nova::Server
75 properties:
76 image: { get_param: image }
77 flavor: { get_param: flavor }
78 key_name: { get_param: key_name }
79 availability_zone: nova
80 networks:
81 - network: { get_param: accessible_network }
82 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
83 # support multitenancy use-case. Use private_floating_network for IPAM only.
84 user_data_format: RAW
85 user_data: { get_resource: software_config }
86 metadata: { get_param: metadata }
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 wait_handle:
97 type: OS::Heat::WaitConditionHandle
98 wait_condition:
99 type: OS::Heat::WaitCondition
100 properties:
101 handle: { get_resource: wait_handle }
102 timeout: { get_param: boot_timeout }
103
104
105outputs:
106 server_private_ip:
107 description: IP address of server in private network
108 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
109 server_private_floating_ip:
110 description: IP address of server in private floating network
111 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
112 server_public_ip:
113 description: Floating IP address of server in public network
114 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}