Merge "Updated from global requirements" into stable/pike
[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           - '"%{::osfamily}"'
569           # The following are required for compatibility with the Controller role
570           # where some vendor integrations added hieradata via ExtraConfigPre
571           - neutron_bigswitch_data # Optionally provided by Controller/ComputeExtraConfigPre
572           - neutron_cisco_data # Optionally provided by Controller/ComputeExtraConfigPre
573           - cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
574           - midonet_data #Optionally provided by AllNodesExtraConfig
575           - cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
576         merge_behavior: deeper
577         datafiles:
578           service_names:
579             service_names: {get_param: ServiceNames}
580             sensu::subscriptions: {get_param: MonitoringSubscriptions}
581           service_configs:
582             map_replace:
583               - {get_param: ServiceConfigSettings}
584               - values: {get_attr: [NetIpMap, net_ip_map]}
585           {{role.name.lower()}}_extraconfig:
586             map_merge:
587 {%- if role.deprecated_param_extraconfig is defined %}
588               - {get_param: {{role.deprecated_param_extraconfig}}}
589 {%- endif %}
590               - {get_param: {{server_resource_name}}ExtraConfig}
591           extraconfig: {get_param: ExtraConfig}
592           {{role.name.lower()}}:
593             tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
594             tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: LoggingSources}
595             tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: LoggingGroups}
596             fqdn_internal_api: {get_attr: [NetHostMap, value, internal_api, fqdn]}
597             fqdn_storage: {get_attr: [NetHostMap, value, storage, fqdn]}
598             fqdn_storage_mgmt: {get_attr: [NetHostMap, value, storage_mgmt, fqdn]}
599             fqdn_tenant: {get_attr: [NetHostMap, value, tenant, fqdn]}
600             fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]}
601             fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
602             fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]}
603
604   # Resource for site-specific injection of root certificate
605   NodeTLSCAData:
606     depends_on: NetworkDeployment
607     type: OS::TripleO::NodeTLSCAData
608     properties:
609       server: {get_resource: {{server_resource_name}}}
610
611   {%- if 'primary' in role.tags and 'controller' in role.tags %}
612   # Resource for site-specific passing of private keys/certificates
613   NodeTLSData:
614     depends_on: NodeTLSCAData
615     type: OS::TripleO::NodeTLSData
616     properties:
617       server: {get_resource: {{server_resource_name}}}
618       NodeIndex: {get_param: NodeIndex}
619   {%- endif -%}
620
621   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
622   {{role.name}}ExtraConfigPre:
623     depends_on: {{server_resource_name}}Deployment
624     type: OS::TripleO::{{role.name}}ExtraConfigPre
625     # We have to use conditions here so that we don't break backwards
626     # compatibility with templates everywhere
627     condition: server_not_blacklisted
628     properties:
629         server: {get_resource: {{server_resource_name}}}
630
631   # Hook for site-specific additional pre-deployment config,
632   # applying to all nodes, e.g node registration/unregistration
633   NodeExtraConfig:
634     depends_on:
635       - {{role.name}}ExtraConfigPre
636   {%- if 'primary' in role.tags and 'controller' in role.tags %}
637       - NodeTLSData
638   {%- else %}
639       - NodeTLSCAData
640   {%- endif %}
641     type: OS::TripleO::NodeExtraConfig
642     # We have to use conditions here so that we don't break backwards
643     # compatibility with templates everywhere
644     condition: server_not_blacklisted
645     properties:
646         server: {get_resource: {{server_resource_name}}}
647
648   UpdateConfig:
649     type: OS::TripleO::Tasks::PackageUpdate
650
651   UpdateDeployment:
652     type: OS::Heat::SoftwareDeployment
653     depends_on: NetworkDeployment
654     properties:
655       name: UpdateDeployment
656       config: {get_resource: UpdateConfig}
657       server: {get_resource: {{server_resource_name}}}
658       input_values:
659         update_identifier:
660           get_param: UpdateIdentifier
661       actions:
662         if:
663           - server_not_blacklisted
664           - ['CREATE', 'UPDATE']
665           - []
666
667   DeploymentActions:
668     type: OS::Heat::Value
669     properties:
670       value:
671         if:
672           - server_not_blacklisted
673           - ['CREATE', 'UPDATE']
674           - []
675
676   SshHostPubKey:
677     type: OS::TripleO::Ssh::HostPubKey
678     depends_on: {{server_resource_name}}Deployment
679     properties:
680         server: {get_resource: {{server_resource_name}}}
681         deployment_actions: {get_attr: [DeploymentActions, value]}
682
683 outputs:
684   ip_address:
685     description: IP address of the server in the ctlplane network
686     value: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
687   hostname:
688     description: Hostname of the server
689     value: {get_attr: [{{server_resource_name}}, name]}
690   hostname_map:
691     description: Mapping of network names to hostnames
692     value:
693   {%- for network in networks %}
694       {{network.name_lower|default(network.name.lower())}}: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower()) }}, fqdn]}
695   {%- endfor %}
696       ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
697   hosts_entry:
698     value:
699       str_replace:
700         template: |
701           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
702   {%- for network in networks %}
703           {{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
704   {%- endfor %}
705           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
706         params:
707           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
708           DOMAIN: {get_param: CloudDomain}
709           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
710   {%- for network in networks %}
711           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
712           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
713   {%- endfor %}
714           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
715           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
716   known_hosts_entry:
717     description: Entry for ssh known hosts
718     value:
719       str_replace:
720         template: "PRIMARYIP,PRIMARYHOST.DOMAIN,PRIMARYHOST,\
721   {%- for network in networks %}
722 {{network.name}}IP,{{network.name}}HOST.DOMAIN,{{network.name}}HOST,\
723   {%- endfor %}
724 CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
725         params:
726           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
727           DOMAIN: {get_param: CloudDomain}
728           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
729   {%- for network in networks %}
730           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
731           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
732   {%- endfor %}
733           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
734           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
735           HOSTSSHPUBKEY: {get_attr: [SshHostPubKey, ecdsa]}
736   nova_server_resource:
737     description: Heat resource handle for {{role.name}} server
738     value:
739       {get_resource: {{server_resource_name}}}
740     condition: server_not_blacklisted
741   deployed_server_port_map:
742     description: |
743       Map of Heat created hostname of the server to ip address. This is the
744       hostname before it has been mapped with the HostnameMap parameter, and
745       the IP address from the ctlplane network. This map can be used to construct
746       the DeployedServerPortMap parameter when using split-stack.
747     value:
748       map_replace:
749         - hostname:
750             fixed_ips:
751               - ip_address: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
752         - keys:
753             hostname:
754               list_join:
755                 - '-'
756                 - - {get_param: Hostname}
757                   - ctlplane
758   deployed_server_deployment_swift_data_map:
759     description:
760       Map of Heat created hostname of the server to the Swift container and object
761       used to created the temporary url for metadata polling with
762       os-collect-config.
763     value:
764       map_replace:
765         - hostname:
766             container:
767               str_split:
768                 - '/'
769                 - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
770                 - 5
771             object:
772               str_split:
773                 - '?'
774                 - str_split:
775                     - '/'
776                     - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
777                     - 6
778                 - 0
779         - keys: {hostname: {get_param: Hostname}}
780   {%- if 'primary' in role.tags and 'controller' in role.tags %}
781   tls_key_modulus_md5:
782     description: MD5 checksum of the TLS Key Modulus
783     value: {get_attr: [NodeTLSData, key_modulus_md5]}
784   tls_cert_modulus_md5:
785     description: MD5 checksum of the TLS Certificate Modulus
786     value: {get_attr: [NodeTLSData, cert_modulus_md5]}
787   {%- endif %}
788   os_collect_config:
789     description: The os-collect-config configuration associated with this server resource
790     value: {get_attr: [{{server_resource_name}}, os_collect_config]}
791   {%- for network in networks %}
792   {{network.name_lower|default(network.name.lower())}}_ip_address:
793     description: IP address of the server in the {{network.name}} network
794     value: {get_attr: [{{network.name}}Port, ip_address]}
795   {%- endfor %}