blob: 166b510920cc8dd02ccde86f5a867868f4346931 [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: ''
45
46resources:
47
48 software_config:
49 type: OS::Heat::SoftwareConfig
50 properties:
51 group: ungrouped
52 config:
53 str_replace:
54 template: { get_file: ../scripts/instance_boot.sh }
55 params:
56 $node_type: { get_param: node_type }
57 $wait_condition_notify: { get_attr: [ wait_handle, curl_cli ] }
58 $ucp_license_key: { get_file: ../scripts/license.lic }
59 $ucp_master_host: { get_param: ucp_master_host }
60 $node_metadata: { get_param: metadata }
61 $host_interface: { get_param: host_interface }
62 $private_floating_interface: { get_param: private_floating_interface }
63 $private_floating_network_cidr: { str_split: ['/', { get_param: private_floating_network_cidr }, 1] }
64 $private_floating_interface_ip: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
65 $functions_override: { get_param: functions_override }
66
67 server:
68 type: OS::Nova::Server
69 properties:
70 image: { get_param: image }
71 flavor: { get_param: flavor }
72 key_name: { get_param: key_name }
73 availability_zone: nova
74 networks:
75 - network: { get_param: accessible_network }
76 # NOTE(ohryhorov): connect to accessible network only as ironic doesn't
77 # support multitenancy use-case. Use private_floating_network for IPAM only.
78 user_data_format: RAW
79 user_data: { get_resource: software_config }
80 metadata: { get_param: metadata }
81
82 private_floating_server_port:
83 type: OS::Neutron::Port
84 properties:
85 network_id: { get_param: private_floating_network }
86 port_security_enabled: false
87 fixed_ips:
88 - subnet: { get_param: private_floating_subnet_id }
89
90 wait_handle:
91 type: OS::Heat::WaitConditionHandle
92 wait_condition:
93 type: OS::Heat::WaitCondition
94 properties:
95 handle: { get_resource: wait_handle }
96 timeout: { get_param: boot_timeout }
97
98
99outputs:
100 server_private_ip:
101 description: IP address of server in private network
102 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}
103 server_private_floating_ip:
104 description: IP address of server in private floating network
105 value: { get_attr: [private_floating_server_port, fixed_ips, 0, ip_address] }
106 server_public_ip:
107 description: Floating IP address of server in public network
108 value: { get_attr: [server, networks, { get_param: accessible_network}, 0]}