d53afd04582e710306e5ca20b90402027632c343
[apex-tripleo-heat-templates.git] / puppet / role.role.j2.yaml
1 {#- ## Some variables are set to enable rendering backwards compatible templates #}
2 {#- ## where a few parameter/resource names don't match the expected pattern #}
3 {#- ## FIXME: we need some way to deprecate the old inconsistent parameters #}
4 {%- set server_resource_name = role.deprecated_server_resource_name|default(role.name) -%}
5 heat_template_version: pike
6 description: 'OpenStack {{role.name}} node configured by Puppet'
7 parameters:
8 {%- set default_flavor_name = 'baremetal' %}
9 {%- if role.deprecated_param_flavor is defined %}
10   {{role.deprecated_param_flavor}}:
11     description: DEPRECATED Use Overcloud{{role.name}}Flavor instead.
12     default: {{default_flavor_name}}
13     type: string
14 {%- endif %}
15   Overcloud{{role.name}}Flavor:
16     description: Flavor for the {{role.name}} node.
17     default: {{default_flavor_name}}
18     type: string
19 {%- if role.disable_constraints is not defined %}
20     constraints:
21       - custom_constraint: nova.flavor
22 {%- endif %}
23 {%- set default_image_name = 'overcloud-full' %}
24 {%- if role.deprecated_param_image is defined %}
25   {{role.deprecated_param_image}}:
26     type: string
27     default: {{default_image_name}}
28     description: DEPRECATED Use {{role.name}}Image instead
29 {%- endif %}
30   {{role.name}}Image:
31     type: string
32     default: {{default_image_name}}
33     description: The disk image file to use for the role.
34 {%- if role.disable_constraints is not defined %}
35     constraints:
36       - custom_constraint: glance.image
37 {%- endif %}
38   ImageUpdatePolicy:
39     default: 'REBUILD_PRESERVE_EPHEMERAL'
40     description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
41     type: string
42   KeyName:
43     description: Name of an existing Nova key pair to enable SSH access to the instances
44     type: string
45     default: default
46 {%- if role.disable_constraints is not defined %}
47     constraints:
48       - custom_constraint: nova.keypair
49 {%- endif %}
50   NeutronPhysicalBridge:
51     default: 'br-ex'
52     description: An OVS bridge to create for accessing external networks.
53     type: string
54   NeutronPublicInterface:
55     default: nic1
56     description: Which interface to add to the NeutronPhysicalBridge.
57     type: string
58   ServiceNetMap:
59     default: {}
60     description: Mapping of service_name -> network name. Typically set
61                  via parameter_defaults in the resource registry.
62     type: json
63   EndpointMap:
64     default: {}
65     description: Mapping of service endpoint -> protocol. Typically set
66                  via parameter_defaults in the resource registry.
67     type: json
68   UpdateIdentifier:
69     default: ''
70     type: string
71     description: >
72       Setting to a previously unused value during stack-update will trigger
73       package update on all nodes
74   Hostname:
75     type: string
76     default: '' # Defaults to Heat created hostname
77   HostnameMap:
78     type: json
79     default: {}
80     description: Optional mapping to override hostnames
81   ExtraConfig:
82     default: {}
83     description: |
84       Additional hiera configuration to inject into the cluster. Note
85       that {{role.name}}ExtraConfig takes precedence over ExtraConfig.
86     type: json
87   {{role.name}}ExtraConfig:
88     default: {}
89     description: |
90       Role specific additional hiera configuration to inject into the cluster.
91     type: json
92 {%- if role.deprecated_param_extraconfig is defined %}
93   {{role.deprecated_param_extraconfig}}:
94     default: {}
95     description: |
96       DEPRECATED use {{role.name}}ExtraConfig instead
97     type: json
98 {%- endif %}
99   {{role.name}}IPs:
100     default: {}
101     type: json
102 {%- if role.deprecated_param_ips is defined %}
103   {{role.deprecated_param_ips}}:
104     default: {}
105     description: DEPRECATED - use {{role.name}}IPs instead
106     type: json
107 {%- endif %}
108   {{role.name}}NetworkDeploymentActions:
109     type: comma_delimited_list
110     description: >
111       Heat action when to apply network configuration changes
112     default: []
113   NetworkDeploymentActions:
114     type: comma_delimited_list
115     description: >
116       Heat action when to apply network configuration changes
117     default: ['CREATE']
118   SoftwareConfigTransport:
119     default: POLL_SERVER_CFN
120     description: |
121       How the server should receive the metadata required for software configuration.
122     type: string
123     constraints:
124     - allowed_values: [POLL_SERVER_CFN, POLL_SERVER_HEAT, POLL_TEMP_URL, ZAQAR_MESSAGE]
125   CloudDomain:
126     default: 'localdomain'
127     type: string
128     description: >
129       The DNS domain used for the hosts. This must match the
130       overcloud_domain_name configured on the undercloud.
131   {{role.name}}ServerMetadata:
132     default: {}
133     description: >
134       Extra properties or metadata passed to Nova for the created nodes in
135       the overcloud. It's accessible via the Nova metadata API. This option is
136       role-specific and is merged with the values given to the ServerMetadata
137       parameter.
138     type: json
139 {%- if role.deprecated_param_metadata is defined %}
140   {{role.deprecated_param_metadata}}:
141     default: {}
142     description: DEPRECATED - use {{role.name}}ServerMetadata instead
143     type: json
144 {%- endif %}
145   ServerMetadata:
146     default: {}
147     description: >
148       Extra properties or metadata passed to Nova for the created nodes in
149       the overcloud. It's accessible via the Nova metadata API. This applies to
150       all roles and is merged with a role-specific metadata parameter.
151     type: json
152   {{role.name}}SchedulerHints:
153     type: json
154     description: Optional scheduler hints to pass to nova
155     default: {}
156   NodeIndex:
157     type: number
158     default: 0
159   ServiceConfigSettings:
160     type: json
161     default: {}
162   ServiceNames:
163     type: comma_delimited_list
164     default: []
165   MonitoringSubscriptions:
166     type: comma_delimited_list
167     default: []
168   ServiceMetadataSettings:
169     type: json
170     default: {}
171   ConfigCommand:
172     type: string
173     description: Command which will be run whenever configuration data changes
174     default: os-refresh-config --timeout 14400
175   ConfigCollectSplay:
176     type: number
177     default: 30
178     description: |
179       Maximum amount of time to possibly to delay configuation collection
180       polling. Defaults to 30 seconds. Set to 0 to disable it which will cause
181       the configuration collection to occur as soon as the collection process
182       starts.  This setting is used to prevent the configuration collection
183       processes from polling all at the exact same time.
184   LoggingSources:
185     type: json
186     default: []
187   LoggingGroups:
188     type: comma_delimited_list
189     default: []
190   UpgradeInitCommand:
191     type: string
192     description: |
193       Command or script snippet to run on all overcloud nodes to
194       initialize the upgrade process. E.g. a repository switch.
195     default: ''
196   UpgradeInitCommonCommand:
197     type: string
198     description: |
199       Common commands required by the upgrades process. This should not
200       normally be modified by the operator and is set and unset in the
201       major-upgrade-composable-steps.yaml and major-upgrade-converge.yaml
202       environment files.
203     default: ''
204   DeploymentServerBlacklistDict:
205     default: {}
206     type: json
207     description: >
208       Map of server hostnames to blacklist from any triggered
209       deployments. If the value is 1, the server will be blacklisted. This
210       parameter is generated from the parent template.
211   RoleParameters:
212     type: json
213     description: Parameters specific to the role
214     default: {}
215   DeploymentSwiftDataMap:
216     type: json
217     description: |
218       Map of servers to Swift container and object for storing deployment data.
219       The keys are the Heat assigned hostnames, and the value is a map of the
220       container/object name in Swift. Example value:
221         overcloud-controller-0:
222           container: overcloud-controller
223           object: 0
224         overcloud-controller-1:
225           container: overcloud-controller
226           object: 1
227         overcloud-controller-2:
228           container: overcloud-controller
229           object: 2
230         overcloud-novacompute-0:
231           container: overcloud-compute
232           object: 0
233     default: {}
234
235 {% if role.uses_deprecated_params is defined %}
236 parameter_groups:
237 - label: deprecated
238   description: Do not use deprecated params, they will be removed.
239   parameters:
240 {%- for property in role %}
241 {%- if property.startswith('deprecated_param_') and not role[property].endswith('SchedulerHints') %}
242   - {{role[property]}}
243 {%- endif %}
244 {%- endfor %}
245 {%- endif %}
246
247 conditions:
248   server_not_blacklisted:
249     not:
250       equals:
251         - {get_param: [DeploymentServerBlacklistDict, {get_param: Hostname}]}
252         - 1
253   deployment_swift_data_map_unset:
254     equals:
255       - get_param:
256           - DeploymentSwiftDataMap
257           - {get_param: Hostname}
258       - ""
259 {%- if role.deprecated_param_image is defined %}
260   deprecated_param_image_set:
261     not:
262       equals:
263         - {get_param: {{role.deprecated_param_image}}}
264         - {{default_image_name}}
265 {%- endif %}
266 {%- if role.deprecated_param_flavor is defined %}
267   deprecated_param_flavor_set:
268     not:
269       equals:
270         - {get_param: {{role.deprecated_param_flavor}}}
271         - {{default_flavor_name}}
272 {%- endif %}
273   role_network_deployment_actions_exists:
274     not:
275       equals:
276         - {get_param: {{role.name}}NetworkDeploymentActions}
277         - []
278
279 resources:
280   {{server_resource_name}}:
281     type: OS::TripleO::{{role.name}}Server
282     metadata:
283       os-collect-config:
284         command: {get_param: ConfigCommand}
285         splay: {get_param: ConfigCollectSplay}
286     properties:
287       image:
288 {%- if role.deprecated_param_image is defined %}
289         if:
290           - deprecated_param_image_set
291           - {get_param: {{role.deprecated_param_image}}}
292           - {get_param: {{role.name}}Image}
293 {%- else %}
294         get_param: {{role.name}}Image
295 {%- endif %}
296       image_update_policy: {get_param: ImageUpdatePolicy}
297       flavor: 
298 {%- if role.deprecated_param_flavor is defined %}
299         if:
300           - deprecated_param_flavor_set
301           - {get_param: {{role.deprecated_param_flavor}}}
302           - {get_param: Overcloud{{role.name}}Flavor}
303 {%- else %}
304         get_param: Overcloud{{role.name}}Flavor
305 {%- endif %}
306       key_name: {get_param: KeyName}
307       networks:
308         - network: ctlplane
309       user_data_format: SOFTWARE_CONFIG
310       user_data: {get_resource: UserData}
311       name:
312         str_replace:
313             template: {get_param: Hostname}
314             params: {get_param: HostnameMap}
315       software_config_transport: {get_param: SoftwareConfigTransport}
316       metadata:
317         map_merge:
318           - {get_param: ServerMetadata}
319 {%- if role.deprecated_param_metadata is defined %}
320           - {get_param: {{role.deprecated_param_metadata}}}
321 {%- endif %}
322           - {get_param: {{role.name}}ServerMetadata}
323           - {get_param: ServiceMetadataSettings}
324       scheduler_hints: {get_param: {{role.name}}SchedulerHints}
325       deployment_swift_data:
326         if:
327           - deployment_swift_data_map_unset
328           - {}
329           - {get_param: [DeploymentSwiftDataMap,
330                          {get_param: Hostname}]}
331
332   # Combine the NodeAdminUserData and NodeUserData mime archives
333   UserData:
334     type: OS::Heat::MultipartMime
335     properties:
336       parts:
337       - config: {get_resource: NodeAdminUserData}
338         type: multipart
339       - config: {get_resource: NodeUserData}
340         type: multipart
341       - config: {get_resource: RoleUserData}
342         type: multipart
343
344   # Creates the "heat-admin" user if configured via the environment
345   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
346   NodeAdminUserData:
347     type: OS::TripleO::NodeAdminUserData
348
349   # For optional operator additional userdata
350   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
351   NodeUserData:
352     type: OS::TripleO::NodeUserData
353
354   # For optional operator role-specific userdata
355   # Should return a OS::Heat::MultipartMime reference via OS::stack_id
356   RoleUserData:
357     type: OS::TripleO::{{role.name}}::NodeUserData
358
359   {%- for network in networks %}
360   {{network.name}}Port:
361     type: OS::TripleO::{{role.name}}::Ports::{{network.name}}Port
362     properties:
363       ControlPlaneIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
364       IPPool:
365         map_merge:
366 {%- if role.deprecated_param_ips is defined %}
367           - {get_param: {{role.deprecated_param_ips}}}
368 {%- endif %}
369           - {get_param: {{role.name}}IPs}
370       NodeIndex: {get_param: NodeIndex}
371   {%- endfor %}
372
373   NetworkConfig:
374     type: OS::TripleO::{{role.name}}::Net::SoftwareConfig
375     properties:
376       ControlPlaneIp: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
377   {%- for network in networks %}
378       {{network.name}}IpSubnet: {get_attr: [{{network.name}}Port, ip_subnet]}
379   {%- endfor %}
380
381   NetIpMap:
382     type: OS::TripleO::Network::Ports::NetIpMap
383     properties:
384       ControlPlaneIp: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
385   {%- for network in networks %}
386       {{network.name}}Ip: {get_attr: [{{network.name}}Port, ip_address]}
387       {{network.name}}IpSubnet: {get_attr: [{{network.name}}Port, ip_subnet]}
388       {{network.name}}IpUri: {get_attr: [{{network.name}}Port, ip_address_uri]}
389   {%- endfor %}
390
391   NetHostMap:
392     type: OS::Heat::Value
393     properties:
394       type: json
395       value:
396         external:
397           fqdn:
398             list_join:
399             - '.'
400             - - {get_attr: [{{server_resource_name}}, name]}
401               - external
402               - {get_param: CloudDomain}
403           short:
404             list_join:
405             - '.'
406             - - {get_attr: [{{server_resource_name}}, name]}
407               - external
408         internal_api:
409           fqdn:
410             list_join:
411             - '.'
412             - - {get_attr: [{{server_resource_name}}, name]}
413               - internalapi
414               - {get_param: CloudDomain}
415           short:
416             list_join:
417             - '.'
418             - - {get_attr: [{{server_resource_name}}, name]}
419               - internalapi
420         storage:
421           fqdn:
422             list_join:
423             - '.'
424             - - {get_attr: [{{server_resource_name}}, name]}
425               - storage
426               - {get_param: CloudDomain}
427           short:
428             list_join:
429             - '.'
430             - - {get_attr: [{{server_resource_name}}, name]}
431               - storage
432         storage_mgmt:
433           fqdn:
434             list_join:
435             - '.'
436             - - {get_attr: [{{server_resource_name}}, name]}
437               - storagemgmt
438               - {get_param: CloudDomain}
439           short:
440             list_join:
441             - '.'
442             - - {get_attr: [{{server_resource_name}}, name]}
443               - storagemgmt
444         tenant:
445           fqdn:
446             list_join:
447             - '.'
448             - - {get_attr: [{{server_resource_name}}, name]}
449               - tenant
450               - {get_param: CloudDomain}
451           short:
452             list_join:
453             - '.'
454             - - {get_attr: [{{server_resource_name}}, name]}
455               - tenant
456         management:
457           fqdn:
458             list_join:
459             - '.'
460             - - {get_attr: [{{server_resource_name}}, name]}
461               - management
462               - {get_param: CloudDomain}
463           short:
464             list_join:
465             - '.'
466             - - {get_attr: [{{server_resource_name}}, name]}
467               - management
468         ctlplane:
469           fqdn:
470             list_join:
471             - '.'
472             - - {get_attr: [{{server_resource_name}}, name]}
473               - ctlplane
474               - {get_param: CloudDomain}
475           short:
476             list_join:
477             - '.'
478             - - {get_attr: [{{server_resource_name}}, name]}
479               - ctlplane
480
481   PreNetworkConfig:
482     type: OS::TripleO::{{role.name}}::PreNetworkConfig
483     properties:
484       server: {get_resource: {{server_resource_name}}}
485       RoleParameters: {get_param: RoleParameters}
486       ServiceNames: {get_param: ServiceNames}
487       deployment_actions: {get_attr: [DeploymentActions, value]}
488
489   NetworkDeployment:
490     type: OS::TripleO::SoftwareDeployment
491     depends_on: PreNetworkConfig
492     properties:
493       name: NetworkDeployment
494       config: {get_resource: NetworkConfig}
495       server: {get_resource: {{server_resource_name}}}
496       actions: {get_param: NetworkDeploymentActions}
497       input_values:
498         bridge_name: {get_param: NeutronPhysicalBridge}
499         interface_name: {get_param: NeutronPublicInterface}
500       actions:
501         if:
502           - server_not_blacklisted
503           - if:
504             - role_network_deployment_actions_exists
505             - {get_param: {{role.name}}NetworkDeploymentActions}
506             - {get_param: NetworkDeploymentActions}
507           - []
508
509   {{server_resource_name}}UpgradeInitConfig:
510     type: OS::Heat::SoftwareConfig
511     properties:
512       group: script
513       config:
514         list_join:
515         - ''
516         - - "#!/bin/bash\n\n"
517           - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
518           - get_param: UpgradeInitCommand
519           - get_param: UpgradeInitCommonCommand
520
521   # Note we may be able to make this conditional on UpgradeInitCommandNotEmpty
522   # but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first
523   {{server_resource_name}}UpgradeInitDeployment:
524     type: OS::Heat::SoftwareDeployment
525     depends_on: NetworkDeployment
526     properties:
527       name: {{server_resource_name}}UpgradeInitDeployment
528       server: {get_resource: {{server_resource_name}}}
529       config: {get_resource: {{server_resource_name}}UpgradeInitConfig}
530       actions:
531         if:
532           - server_not_blacklisted
533           - ['CREATE', 'UPDATE']
534           - []
535
536   {{server_resource_name}}Deployment:
537     type: OS::Heat::StructuredDeployment
538     depends_on: {{server_resource_name}}UpgradeInitDeployment
539     properties:
540       name: {{server_resource_name}}Deployment
541       config: {get_resource: {{server_resource_name}}Config}
542       server: {get_resource: {{server_resource_name}}}
543       input_values:
544         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
545       actions:
546         if:
547           - server_not_blacklisted
548           - ['CREATE', 'UPDATE']
549           - []
550
551   {{server_resource_name}}Config:
552     type: OS::Heat::StructuredConfig
553     properties:
554       group: hiera
555       config:
556         hierarchy:
557           - '"%{::uuid}"'
558           - heat_config_%{::deploy_config_name}
559           - config_step
560           - {{role.name.lower()}}_extraconfig
561           - extraconfig
562           - service_names
563           - service_configs
564           - {{role.name.lower()}}
565           - bootstrap_node # provided by allNodesConfig
566           - all_nodes # provided by allNodesConfig
567           - vip_data # provided by allNodesConfig
568           - net_ip_map
569           - '"%{::osfamily}"'
570           # The following are required for compatibility with the Controller role
571           # where some vendor integrations added hieradata via ExtraConfigPre
572           - neutron_bigswitch_data # Optionally provided by Controller/ComputeExtraConfigPre
573           - neutron_cisco_data # Optionally provided by Controller/ComputeExtraConfigPre
574           - cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
575           - midonet_data #Optionally provided by AllNodesExtraConfig
576           - cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
577         merge_behavior: deeper
578         datafiles:
579           service_names:
580             service_names: {get_param: ServiceNames}
581             sensu::subscriptions: {get_param: MonitoringSubscriptions}
582           net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
583           service_configs:
584             map_replace:
585               - {get_param: ServiceConfigSettings}
586               - values: {get_attr: [NetIpMap, net_ip_map]}
587           {{role.name.lower()}}_extraconfig:
588             map_merge:
589 {%- if role.deprecated_param_extraconfig is defined %}
590               - {get_param: {{role.deprecated_param_extraconfig}}}
591 {%- endif %}
592               - {get_param: {{server_resource_name}}ExtraConfig}
593           extraconfig: {get_param: ExtraConfig}
594           {{role.name.lower()}}:
595             tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
596             tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: LoggingSources}
597             tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: LoggingGroups}
598             fqdn_internal_api: {get_attr: [NetHostMap, value, internal_api, fqdn]}
599             fqdn_storage: {get_attr: [NetHostMap, value, storage, fqdn]}
600             fqdn_storage_mgmt: {get_attr: [NetHostMap, value, storage_mgmt, fqdn]}
601             fqdn_tenant: {get_attr: [NetHostMap, value, tenant, fqdn]}
602             fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]}
603             fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
604             fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]}
605
606   # Resource for site-specific injection of root certificate
607   NodeTLSCAData:
608     depends_on: NetworkDeployment
609     type: OS::TripleO::NodeTLSCAData
610     properties:
611       server: {get_resource: {{server_resource_name}}}
612
613   {%- if 'primary' in role.tags and 'controller' in role.tags %}
614   # Resource for site-specific passing of private keys/certificates
615   NodeTLSData:
616     depends_on: NodeTLSCAData
617     type: OS::TripleO::NodeTLSData
618     properties:
619       server: {get_resource: {{server_resource_name}}}
620       NodeIndex: {get_param: NodeIndex}
621   {%- endif -%}
622
623   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
624   {{role.name}}ExtraConfigPre:
625     depends_on: {{server_resource_name}}Deployment
626     type: OS::TripleO::{{role.name}}ExtraConfigPre
627     # We have to use conditions here so that we don't break backwards
628     # compatibility with templates everywhere
629     condition: server_not_blacklisted
630     properties:
631         server: {get_resource: {{server_resource_name}}}
632
633   # Hook for site-specific additional pre-deployment config,
634   # applying to all nodes, e.g node registration/unregistration
635   NodeExtraConfig:
636     depends_on:
637       - {{role.name}}ExtraConfigPre
638   {%- if 'primary' in role.tags and 'controller' in role.tags %}
639       - NodeTLSData
640   {%- else %}
641       - NodeTLSCAData
642   {%- endif %}
643     type: OS::TripleO::NodeExtraConfig
644     # We have to use conditions here so that we don't break backwards
645     # compatibility with templates everywhere
646     condition: server_not_blacklisted
647     properties:
648         server: {get_resource: {{server_resource_name}}}
649
650   UpdateConfig:
651     type: OS::TripleO::Tasks::PackageUpdate
652
653   UpdateDeployment:
654     type: OS::Heat::SoftwareDeployment
655     depends_on: NetworkDeployment
656     properties:
657       name: UpdateDeployment
658       config: {get_resource: UpdateConfig}
659       server: {get_resource: {{server_resource_name}}}
660       input_values:
661         update_identifier:
662           get_param: UpdateIdentifier
663       actions:
664         if:
665           - server_not_blacklisted
666           - ['CREATE', 'UPDATE']
667           - []
668
669   DeploymentActions:
670     type: OS::Heat::Value
671     properties:
672       value:
673         if:
674           - server_not_blacklisted
675           - ['CREATE', 'UPDATE']
676           - []
677
678   SshHostPubKey:
679     type: OS::TripleO::Ssh::HostPubKey
680     depends_on: {{server_resource_name}}Deployment
681     properties:
682         server: {get_resource: {{server_resource_name}}}
683         deployment_actions: {get_attr: [DeploymentActions, value]}
684
685 outputs:
686   ip_address:
687     description: IP address of the server in the ctlplane network
688     value: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
689   hostname:
690     description: Hostname of the server
691     value: {get_attr: [{{server_resource_name}}, name]}
692   hostname_map:
693     description: Mapping of network names to hostnames
694     value:
695   {%- for network in networks %}
696       {{network.name_lower|default(network.name.lower())}}: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower()) }}, fqdn]}
697   {%- endfor %}
698       ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
699   hosts_entry:
700     value:
701       str_replace:
702         template: |
703           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
704   {%- for network in networks %}
705           {{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
706   {%- endfor %}
707           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
708         params:
709           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
710           DOMAIN: {get_param: CloudDomain}
711           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
712   {%- for network in networks %}
713           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
714           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
715   {%- endfor %}
716           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
717           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
718   known_hosts_entry:
719     description: Entry for ssh known hosts
720     value:
721       str_replace:
722         template: "PRIMARYIP,PRIMARYHOST.DOMAIN,PRIMARYHOST,\
723   {%- for network in networks %}
724 {{network.name}}IP,{{network.name}}HOST.DOMAIN,{{network.name}}HOST,\
725   {%- endfor %}
726 CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
727         params:
728           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
729           DOMAIN: {get_param: CloudDomain}
730           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
731   {%- for network in networks %}
732           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
733           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
734   {%- endfor %}
735           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
736           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
737           HOSTSSHPUBKEY: {get_attr: [SshHostPubKey, ecdsa]}
738   nova_server_resource:
739     description: Heat resource handle for {{role.name}} server
740     value:
741       {get_resource: {{server_resource_name}}}
742     condition: server_not_blacklisted
743   deployed_server_port_map:
744     description: |
745       Map of Heat created hostname of the server to ip address. This is the
746       hostname before it has been mapped with the HostnameMap parameter, and
747       the IP address from the ctlplane network. This map can be used to construct
748       the DeployedServerPortMap parameter when using split-stack.
749     value:
750       map_replace:
751         - hostname:
752             fixed_ips:
753               - ip_address: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
754         - keys:
755             hostname:
756               list_join:
757                 - '-'
758                 - - {get_param: Hostname}
759                   - ctlplane
760   deployed_server_deployment_swift_data_map:
761     description:
762       Map of Heat created hostname of the server to the Swift container and object
763       used to created the temporary url for metadata polling with
764       os-collect-config.
765     value:
766       map_replace:
767         - hostname:
768             container:
769               str_split:
770                 - '/'
771                 - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
772                 - 5
773             object:
774               str_split:
775                 - '?'
776                 - str_split:
777                     - '/'
778                     - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
779                     - 6
780                 - 0
781         - keys: {hostname: {get_param: Hostname}}
782   {%- if 'primary' in role.tags and 'controller' in role.tags %}
783   tls_key_modulus_md5:
784     description: MD5 checksum of the TLS Key Modulus
785     value: {get_attr: [NodeTLSData, key_modulus_md5]}
786   tls_cert_modulus_md5:
787     description: MD5 checksum of the TLS Certificate Modulus
788     value: {get_attr: [NodeTLSData, cert_modulus_md5]}
789   {%- endif %}
790   os_collect_config:
791     description: The os-collect-config configuration associated with this server resource
792     value: {get_attr: [{{server_resource_name}}, os_collect_config]}
793   {%- for network in networks %}
794   {{network.name_lower|default(network.name.lower())}}_ip_address:
795     description: IP address of the server in the {{network.name}} network
796     value: {get_attr: [{{network.name}}Port, ip_address]}
797   {%- endfor %}