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