Change flat network name for nosdn fdio scenario
[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         canonical:
481           fqdn:
482             list_join:
483             - '.'
484             - - {get_attr: [{{server_resource_name}}, name]}
485               - {get_param: CloudDomain}
486           short:
487             - {get_attr: [{{server_resource_name}}, name]}
488
489   PreNetworkConfig:
490     type: OS::TripleO::{{role.name}}::PreNetworkConfig
491     properties:
492       server: {get_resource: {{server_resource_name}}}
493       RoleParameters: {get_param: RoleParameters}
494       ServiceNames: {get_param: ServiceNames}
495       deployment_actions: {get_attr: [DeploymentActions, value]}
496
497   NetworkDeployment:
498     type: OS::TripleO::SoftwareDeployment
499     depends_on: PreNetworkConfig
500     properties:
501       name: NetworkDeployment
502       config: {get_resource: NetworkConfig}
503       server: {get_resource: {{server_resource_name}}}
504       actions: {get_param: NetworkDeploymentActions}
505       input_values:
506         bridge_name: {get_param: NeutronPhysicalBridge}
507         interface_name: {get_param: NeutronPublicInterface}
508       actions:
509         if:
510           - server_not_blacklisted
511           - if:
512             - role_network_deployment_actions_exists
513             - {get_param: {{role.name}}NetworkDeploymentActions}
514             - {get_param: NetworkDeploymentActions}
515           - []
516
517   {{server_resource_name}}UpgradeInitConfig:
518     type: OS::Heat::SoftwareConfig
519     properties:
520       group: script
521       config:
522         list_join:
523         - ''
524         - - "#!/bin/bash\n\n"
525           - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
526           - get_param: UpgradeInitCommand
527           - get_param: UpgradeInitCommonCommand
528
529   # Note we may be able to make this conditional on UpgradeInitCommandNotEmpty
530   # but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first
531   {{server_resource_name}}UpgradeInitDeployment:
532     type: OS::Heat::SoftwareDeployment
533     depends_on: NetworkDeployment
534     properties:
535       name: {{server_resource_name}}UpgradeInitDeployment
536       server: {get_resource: {{server_resource_name}}}
537       config: {get_resource: {{server_resource_name}}UpgradeInitConfig}
538       actions:
539         if:
540           - server_not_blacklisted
541           - ['CREATE', 'UPDATE']
542           - []
543
544   {{server_resource_name}}Deployment:
545     type: OS::Heat::StructuredDeployment
546     depends_on: {{server_resource_name}}UpgradeInitDeployment
547     properties:
548       name: {{server_resource_name}}Deployment
549       config: {get_resource: {{server_resource_name}}Config}
550       server: {get_resource: {{server_resource_name}}}
551       input_values:
552         enable_package_upgrade: {get_attr: [UpdateDeployment, update_managed_packages]}
553       actions:
554         if:
555           - server_not_blacklisted
556           - ['CREATE', 'UPDATE']
557           - []
558
559   {{server_resource_name}}Config:
560     type: OS::Heat::StructuredConfig
561     properties:
562       group: hiera
563       config:
564         hierarchy:
565           - '"%{::uuid}"'
566           - heat_config_%{::deploy_config_name}
567           - config_step
568           - {{role.name.lower()}}_extraconfig
569           - extraconfig
570           - service_names
571           - service_configs
572           - {{role.name.lower()}}
573           - bootstrap_node # provided by allNodesConfig
574           - all_nodes # provided by allNodesConfig
575           - vip_data # provided by allNodesConfig
576           - net_ip_map
577           - '"%{::osfamily}"'
578           # The following are required for compatibility with the Controller role
579           # where some vendor integrations added hieradata via ExtraConfigPre
580           - neutron_bigswitch_data # Optionally provided by Controller/ComputeExtraConfigPre
581           - neutron_cisco_data # Optionally provided by Controller/ComputeExtraConfigPre
582           - cisco_n1kv_data # Optionally provided by Controller/ComputeExtraConfigPre
583           - midonet_data #Optionally provided by AllNodesExtraConfig
584           - cisco_aci_data # Optionally provided by Controller/ComputeExtraConfigPre
585           - common # Optionally provided by os-net-config
586         merge_behavior: deeper
587         datafiles:
588           service_names:
589             service_names: {get_param: ServiceNames}
590             sensu::subscriptions: {get_param: MonitoringSubscriptions}
591           net_ip_map: {get_attr: [NetIpMap, net_ip_map]}
592           service_configs:
593             map_replace:
594               - {get_param: ServiceConfigSettings}
595               - values: {get_attr: [NetIpMap, net_ip_map]}
596           {{role.name.lower()}}_extraconfig:
597             map_merge:
598 {%- if role.deprecated_param_extraconfig is defined %}
599               - {get_param: {{role.deprecated_param_extraconfig}}}
600 {%- endif %}
601               - {get_param: {{server_resource_name}}ExtraConfig}
602           extraconfig: {get_param: ExtraConfig}
603           {{role.name.lower()}}:
604             tripleo::packages::enable_upgrade: {get_input: enable_package_upgrade}
605             tripleo::profile::base::logging::fluentd::fluentd_sources: {get_param: LoggingSources}
606             tripleo::profile::base::logging::fluentd::fluentd_groups: {get_param: LoggingGroups}
607             fqdn_internal_api: {get_attr: [NetHostMap, value, internal_api, fqdn]}
608             fqdn_storage: {get_attr: [NetHostMap, value, storage, fqdn]}
609             fqdn_storage_mgmt: {get_attr: [NetHostMap, value, storage_mgmt, fqdn]}
610             fqdn_tenant: {get_attr: [NetHostMap, value, tenant, fqdn]}
611             fqdn_management: {get_attr: [NetHostMap, value, management, fqdn]}
612             fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
613             fqdn_external: {get_attr: [NetHostMap, value, external, fqdn]}
614             fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
615
616   # Resource for site-specific injection of root certificate
617   NodeTLSCAData:
618     depends_on: NetworkDeployment
619     type: OS::TripleO::NodeTLSCAData
620     properties:
621       server: {get_resource: {{server_resource_name}}}
622
623   {%- if 'primary' in role.tags and 'controller' in role.tags %}
624   # Resource for site-specific passing of private keys/certificates
625   NodeTLSData:
626     depends_on: NodeTLSCAData
627     type: OS::TripleO::NodeTLSData
628     properties:
629       server: {get_resource: {{server_resource_name}}}
630       NodeIndex: {get_param: NodeIndex}
631   {%- endif -%}
632
633   # Hook for site-specific additional pre-deployment config, e.g extra hieradata
634   {{role.name}}ExtraConfigPre:
635     depends_on: {{server_resource_name}}Deployment
636     type: OS::TripleO::{{role.name}}ExtraConfigPre
637     # We have to use conditions here so that we don't break backwards
638     # compatibility with templates everywhere
639     condition: server_not_blacklisted
640     properties:
641         server: {get_resource: {{server_resource_name}}}
642
643   # Hook for site-specific additional pre-deployment config,
644   # applying to all nodes, e.g node registration/unregistration
645   NodeExtraConfig:
646     depends_on:
647       - {{role.name}}ExtraConfigPre
648   {%- if 'primary' in role.tags and 'controller' in role.tags %}
649       - NodeTLSData
650   {%- else %}
651       - NodeTLSCAData
652   {%- endif %}
653     type: OS::TripleO::NodeExtraConfig
654     # We have to use conditions here so that we don't break backwards
655     # compatibility with templates everywhere
656     condition: server_not_blacklisted
657     properties:
658         server: {get_resource: {{server_resource_name}}}
659
660   UpdateConfig:
661     type: OS::TripleO::Tasks::PackageUpdate
662
663   UpdateDeployment:
664     type: OS::Heat::SoftwareDeployment
665     depends_on: NetworkDeployment
666     properties:
667       name: UpdateDeployment
668       config: {get_resource: UpdateConfig}
669       server: {get_resource: {{server_resource_name}}}
670       input_values:
671         update_identifier:
672           get_param: UpdateIdentifier
673       actions:
674         if:
675           - server_not_blacklisted
676           - ['CREATE', 'UPDATE']
677           - []
678
679   DeploymentActions:
680     type: OS::Heat::Value
681     properties:
682       value:
683         if:
684           - server_not_blacklisted
685           - ['CREATE', 'UPDATE']
686           - []
687
688   SshHostPubKey:
689     type: OS::TripleO::Ssh::HostPubKey
690     depends_on: {{server_resource_name}}Deployment
691     properties:
692         server: {get_resource: {{server_resource_name}}}
693         deployment_actions: {get_attr: [DeploymentActions, value]}
694
695 outputs:
696   ip_address:
697     description: IP address of the server in the ctlplane network
698     value: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
699   hostname:
700     description: Hostname of the server
701     value: {get_attr: [{{server_resource_name}}, name]}
702   hostname_map:
703     description: Mapping of network names to hostnames
704     value:
705   {%- for network in networks %}
706       {{network.name_lower|default(network.name.lower())}}: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower()) }}, fqdn]}
707   {%- endfor %}
708       ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
709       canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
710   hosts_entry:
711     value:
712       str_replace:
713         template: |
714           PRIMARYIP PRIMARYHOST.DOMAIN PRIMARYHOST
715   {%- for network in networks %}
716           {{network.name}}IP {{network.name}}HOST.DOMAIN {{network.name}}HOST
717   {%- endfor %}
718           CTLPLANEIP CTLPLANEHOST.DOMAIN CTLPLANEHOST
719         params:
720           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
721           DOMAIN: {get_param: CloudDomain}
722           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
723   {%- for network in networks %}
724           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
725           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
726   {%- endfor %}
727           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
728           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
729   known_hosts_entry:
730     description: Entry for ssh known hosts
731     value:
732       str_replace:
733         template: "PRIMARYIP,PRIMARYHOST.DOMAIN,PRIMARYHOST,\
734   {%- for network in networks %}
735 {{network.name}}IP,{{network.name}}HOST.DOMAIN,{{network.name}}HOST,\
736   {%- endfor %}
737 CTLPLANEIP,CTLPLANEHOST.DOMAIN,CTLPLANEHOST HOSTSSHPUBKEY"
738         params:
739           PRIMARYIP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}]}
740           DOMAIN: {get_param: CloudDomain}
741           PRIMARYHOST: {get_attr: [{{server_resource_name}}, name]}
742   {%- for network in networks %}
743           {{network.name}}IP: {get_attr: [{{network.name}}Port, ip_address]}
744           {{network.name}}HOST: {get_attr: [NetHostMap, value, {{network.name_lower|default(network.name.lower())}}, short]}
745   {%- endfor %}
746           CTLPLANEIP: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
747           CTLPLANEHOST: {get_attr: [NetHostMap, value, ctlplane, short]}
748           HOSTSSHPUBKEY: {get_attr: [SshHostPubKey, ecdsa]}
749   nova_server_resource:
750     description: Heat resource handle for {{role.name}} server
751     value:
752       {get_resource: {{server_resource_name}}}
753     condition: server_not_blacklisted
754   deployed_server_port_map:
755     description: |
756       Map of Heat created hostname of the server to ip address. This is the
757       hostname before it has been mapped with the HostnameMap parameter, and
758       the IP address from the ctlplane network. This map can be used to construct
759       the DeployedServerPortMap parameter when using split-stack.
760     value:
761       map_replace:
762         - hostname:
763             fixed_ips:
764               - ip_address: {get_attr: [{{server_resource_name}}, networks, ctlplane, 0]}
765         - keys:
766             hostname:
767               list_join:
768                 - '-'
769                 - - {get_param: Hostname}
770                   - ctlplane
771   deployed_server_deployment_swift_data_map:
772     description:
773       Map of Heat created hostname of the server to the Swift container and object
774       used to created the temporary url for metadata polling with
775       os-collect-config.
776     value:
777       map_replace:
778         - hostname:
779             container:
780               str_split:
781                 - '/'
782                 - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
783                 - 5
784             object:
785               str_split:
786                 - '?'
787                 - str_split:
788                     - '/'
789                     - {get_attr: [{{server_resource_name}}, os_collect_config, request, metadata_url]}
790                     - 6
791                 - 0
792         - keys: {hostname: {get_param: Hostname}}
793   {%- if 'primary' in role.tags and 'controller' in role.tags %}
794   tls_key_modulus_md5:
795     description: MD5 checksum of the TLS Key Modulus
796     value: {get_attr: [NodeTLSData, key_modulus_md5]}
797   tls_cert_modulus_md5:
798     description: MD5 checksum of the TLS Certificate Modulus
799     value: {get_attr: [NodeTLSData, cert_modulus_md5]}
800   {%- endif %}
801   os_collect_config:
802     description: The os-collect-config configuration associated with this server resource
803     value: {get_attr: [{{server_resource_name}}, os_collect_config]}
804   {%- for network in networks %}
805   {{network.name_lower|default(network.name.lower())}}_ip_address:
806     description: IP address of the server in the {{network.name}} network
807     value: {get_attr: [{{network.name}}Port, ip_address]}
808   {%- endfor %}