Don't store Neutron DB credentials on compute node
[apex-tripleo-heat-templates.git] / compute.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   OpenStack hypervisor node. Can be wrapped in a ResourceGroup for scaling.
5
6 parameters:
7   AdminPassword:
8     default: unset
9     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
10     type: string
11     hidden: true
12   CeilometerComputeAgent:
13     description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
14     type: string
15     default: ''
16     constraints:
17     - allowed_values: ['', Present]
18   CeilometerDSN:
19     type: string
20   CeilometerMeteringSecret:
21     default: unset
22     description: Secret shared by the ceilometer services.
23     type: string
24     hidden: true
25   CeilometerPassword:
26     default: unset
27     description: The password for the ceilometer service account.
28     type: string
29     hidden: true
30   Debug:
31     default: ''
32     description: Set to True to enable debugging on all services.
33     type: string
34   ExtraConfig:
35     default: {}
36     description: |
37       Additional configuration to inject into the cluster. The JSON should have
38       the following structure:
39         {"FILEKEY":
40           {"config":
41             [{"section": "SECTIONNAME",
42               "values":
43                 [{"option": "OPTIONNAME",
44                   "value": "VALUENAME"
45                  }
46                 ]
47              }
48             ]
49           }
50         }
51       For instance:
52         {"nova":
53           {"config":
54             [{"section": "default",
55               "values":
56                 [{"option": "force_config_drive",
57                   "value": "always"
58                  }
59                 ]
60              },
61              {"section": "cells",
62               "values":
63                 [{"option": "driver",
64                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
65                  }
66                 ]
67              }
68             ]
69           }
70         }
71     type: json
72   Flavor:
73     description: Flavor for the nova compute node
74     type: string
75     default: baremetal
76     constraints:
77       - custom_constraint: nova.flavor
78   GlanceHost:
79     type: string
80     default: ''  # Has to be here because of the ignored empty value bug
81   GlancePort:
82     default: "9292"
83     description: Glance port.
84     type: string
85   GlanceProtocol:
86     default: http
87     description: Protocol to use when connecting to glance, set to https for SSL.
88     type: string
89   Image:
90     type: string
91     default: overcloud-compute
92     constraints:
93       - custom_constraint: glance.image
94   ImageUpdatePolicy:
95     default: 'REBUILD_PRESERVE_EPHEMERAL'
96     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
97     type: string
98   KeyName:
99     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
100     type: string
101     default: default
102     constraints:
103       - custom_constraint: nova.keypair
104   KeystoneHost:
105     type: string
106     default: ''
107   NeutronBridgeMappings:
108     description: >
109       The OVS logical->physical bridge mappings to use. See the Neutron
110       documentation for details. Defaults to mapping br-ex - the external
111       bridge on hosts - to a physical name 'datacentre' which can be used
112       to create provider networks (and we use this for the default floating
113       network) - if changing this either use different post-install network
114       scripts or be sure to keep 'datacentre' as a mapping network name.
115     type: string
116     default: ""
117   NeutronEnableTunnelling:
118     type: string
119     default: "True"
120   NeutronFlatNetworks:
121     type: string
122     default: ''
123     description: >
124       If set, flat networks to configure in neutron plugins.
125   NeutronHost:
126     type: string
127     default: ''  # Has to be here because of the ignored empty value bug
128   NeutronNetworkType:
129     type: string
130     description: The tenant network type for Neutron, either gre or vxlan.
131     default: 'gre'
132   NeutronNetworkVLANRanges:
133     default: 'datacentre'
134     description: >
135       The Neutron ML2 and OpenVSwitch vlan mapping range to support. See the
136       Neutron documentation for permitted values. Defaults to permitting any
137       VLAN on the 'datacentre' physical network (See NeutronBridgeMappings).
138     type: string
139   NeutronPassword:
140     default: unset
141     description: The password for the neutron service account, used by neutron agents.
142     type: string
143     hidden: true
144   NeutronPhysicalBridge:
145     default: ''
146     description: An OVS bridge to create for accessing external networks.
147     type: string
148   NeutronPublicInterface:
149     default: eth0
150     description: A port to add to the NeutronPhysicalBridge.
151     type: string
152   NeutronTunnelTypes:
153     type: string
154     description: |
155         The tunnel types for the Neutron tenant network. To specify multiple
156         values, use a comma separated string, like so: 'gre,vxlan'
157     default: 'gre'
158   NeutronPublicInterfaceRawDevice:
159     default: ''
160     type: string
161   NeutronDVR:
162     default: 'False'
163     type: string
164   NeutronMetadataProxySharedSecret:
165     default: 'unset'
166     description: Shared secret to prevent spoofing
167     type: string
168   NeutronMechanismDrivers:
169     default: 'openvswitch'
170     description: |
171         The mechanism drivers for the Neutron tenant network. To specify multiple
172         values, use a comma separated string, like so: 'openvswitch,l2_population'
173     type: string
174   NeutronAllowL3AgentFailover:
175     default: 'True'
176     description: Allow automatic l3-agent failover
177     type: string
178   NeutronAgentMode:
179     default: 'dvr_snat'
180     description: Agent mode for the neutron-l3-agent on the controller hosts
181     type: string
182   NovaApiHost:
183     type: string
184     default: ''  # Has to be here because of the ignored empty value bug
185   NovaComputeDriver:
186     type: string
187     default: libvirt.LibvirtDriver
188   NovaComputeExtraConfig:
189     default: {}
190     description: |
191       NovaCompute specific configuration to inject into the cluster. Same
192       structure as ExtraConfig.
193     type: json
194   NovaComputeLibvirtType:
195     type: string
196     default: ''
197   NovaPassword:
198     default: unset
199     description: The password for the nova service account, used by nova-api.
200     type: string
201     hidden: true
202   NovaPublicIP:
203     type: string
204     default: ''  # Has to be here because of the ignored empty value bug
205   NtpServer:
206     type: string
207     default: ''
208   RabbitHost:
209     type: string
210     default: ''  # Has to be here because of the ignored empty value bug
211   RabbitPassword:
212     default: guest
213     description: The password for RabbitMQ
214     type: string
215     hidden: true
216   RabbitUserName:
217     default: guest
218     description: The username for RabbitMQ
219     type: string
220   SnmpdReadonlyUserName:
221     default: ro_snmp_user
222     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
223     type: string
224   SnmpdReadonlyUserPassword:
225     default: unset
226     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
227     type: string
228     hidden: true
229
230
231 resources:
232
233   NovaCompute:
234     type: OS::Nova::Server
235     properties:
236       image:
237         {get_param: Image}
238       image_update_policy:
239         get_param: ImageUpdatePolicy
240       flavor: {get_param: Flavor}
241       key_name: {get_param: KeyName}
242       networks:
243         - network: ctlplane
244       user_data_format: SOFTWARE_CONFIG
245
246   NovaComputeConfig:
247     type: OS::TripleO::Compute::SoftwareConfig
248
249   NovaComputeDeployment:
250     type: OS::TripleO::SoftwareDeployment
251     properties:
252       signal_transport: NO_SIGNAL
253       config: {get_attr: [NovaComputeConfig, config_id]}
254       server: {get_resource: NovaCompute}
255       input_values:
256         debug: {get_param: Debug}
257         nova_compute_driver: {get_param: NovaComputeDriver}
258         nova_compute_libvirt_type: {get_param: NovaComputeLibvirtType}
259         nova_public_ip: {get_param: NovaPublicIP}
260         nova_api_host: {get_param: NovaApiHost}
261         nova_password: {get_param: NovaPassword}
262         ceilometer_dsn: {get_param: CeilometerDSN}
263         ceilometer_metering_secret: {get_param: CeilometerMeteringSecret}
264         ceilometer_password: {get_param: CeilometerPassword}
265         ceilometer_compute_agent: {get_param: CeilometerComputeAgent}
266         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
267         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
268         glance_host: {get_param: GlanceHost}
269         glance_port: {get_param: GlancePort}
270         glance_protocol: {get_param: GlanceProtocol}
271         keystone_host: {get_param: KeystoneHost}
272         neutron_flat_networks: {get_param: NeutronFlatNetworks}
273         neutron_host: {get_param: NeutronHost}
274         neutron_local_ip: {get_attr: [NovaCompute, networks, ctlplane, 0]}
275         neutron_tenant_network_type: {get_param: NeutronNetworkType}
276         neutron_tunnel_types: {get_param: NeutronTunnelTypes}
277         neutron_network_vlan_ranges: {get_param: NeutronNetworkVLANRanges}
278         neutron_bridge_mappings: {get_param: NeutronBridgeMappings}
279         neutron_enable_tunneling: {get_param: NeutronEnableTunnelling}
280         neutron_physical_bridge: {get_param: NeutronPhysicalBridge}
281         neutron_public_interface: {get_param: NeutronPublicInterface}
282         neutron_password: {get_param: NeutronPassword}
283         neutron_agent_mode: {get_param: NeutronAgentMode}
284         neutron_router_distributed: {get_param: NeutronDVR}
285         neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
286         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
287         neutron_allow_l3agent_failover: {get_param: NeutronAllowL3AgentFailover}
288         neutron_public_interface_raw_device: {get_param: NeutronPublicInterfaceRawDevice}
289         admin_password: {get_param: AdminPassword}
290         rabbit_host: {get_param: RabbitHost}
291         rabbit_username: {get_param: RabbitUserName}
292         rabbit_password: {get_param: RabbitPassword}
293         ntp_server: {get_param: NtpServer}
294
295   NovaComputePassthrough:
296     type: OS::Heat::StructuredConfig
297     properties:
298       group: os-apply-config
299       config: {get_input: passthrough_config}
300
301   NovaComputePassthroughSpecific:
302     type: OS::Heat::StructuredConfig
303     properties:
304       group: os-apply-config
305       config: {get_input: passthrough_config_specific}
306
307   NovaComputePassthroughDeployment:
308     depends_on: [NovaComputeDeployment]
309     type: OS::Heat::StructuredDeployment
310     properties:
311       config: {get_resource: NovaComputePassthrough}
312       server: {get_resource: NovaCompute}
313       signal_transport: NO_SIGNAL
314       input_values:
315         passthrough_config: {get_param: ExtraConfig}
316
317   NovaComputePassthroughDeploymentSpecific:
318     depends_on: [NovaComputePassthroughDeployment]
319     type: OS::Heat::StructuredDeployment
320     properties:
321       config: {get_resource: NovaComputePassthroughSpecific}
322       server: {get_resource: NovaCompute}
323       signal_transport: NO_SIGNAL
324       input_values:
325         passthrough_config_specific: {get_param: NovaComputeExtraConfig}
326
327 outputs:
328   ip_address:
329     description: IP address of the server in the ctlplane network
330     value: {get_attr: [NovaCompute, networks, ctlplane, 0]}
331   hostname:
332     description: Hostname of the server
333     value: {get_attr: [NovaCompute, name]}
334   hosts_entry:
335     description: >
336       Server's IP address and hostname in the /etc/hosts format
337     value:
338       str_replace:
339         template: "IP HOST HOST.novalocal"
340         params:
341           IP: {get_attr: [NovaCompute, networks, ctlplane, 0]}
342           HOST: {get_attr: [NovaCompute, name]}
343   nova_server_resource:
344     description: Heat resource handle for the Nova compute server
345     value:
346       {get_resource: NovaCompute}