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