Merge "Remove baremetal cron jobs on docker upgrade"
[apex-tripleo-heat-templates.git] / extraconfig / nova_metadata / krb-service-principals.j2.yaml
1 heat_template_version: pike
2 description: 'Generates the relevant service principals for a server'
3
4 parameters:
5   RoleData:
6      type: json
7      description: the list containing the 'role_data' output for the ServiceChain
8 {%- for network in networks if network.vip|default(false) %}
9 {%- if network.name == 'External' %}
10   # Special case the External hostname param, which is CloudName
11   CloudName:
12     default: overcloud.localdomain
13     description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
14     type: string
15 {%- elif network.name == 'InternalApi' %}
16   # Special case the Internal API hostname param, which is CloudNameInternal
17   CloudNameInternal:
18     default: overcloud.{{network.name.lower()}}.localdomain
19     description: >
20       The DNS name of this cloud's {{network.name_lower}} endpoint. E.g.
21       'ci-overcloud.{{network.name.lower()}}.tripleo.org'.
22     type: string
23 {%- elif network.name == 'StorageMgmt' %}
24   # Special case StorageMgmt hostname param, which is CloudNameStorageManagement
25   CloudNameStorageManagement:
26     default: overcloud.{{network.name.lower()}}.localdomain
27     description: >
28       The DNS name of this cloud's {{network.name_lower}} endpoint. E.g.
29       'ci-overcloud.{{network.name.lower()}}.tripleo.org'.
30     type: string
31 {%- else %}
32   CloudName{{network.name}}:
33     default: overcloud.{{network.name.lower()}}.localdomain
34     description: >
35       The DNS name of this cloud's {{network.name_lower}} endpoint. E.g.
36       'ci-overcloud.{{network.name.lower()}}.tripleo.org'.
37     type: string
38 {%- endif %}
39 {%- endfor %}
40   CloudNameCtlplane:
41     default: overcloud.ctlplane.localdomain
42     description: >
43       The DNS name of this cloud's provisioning network endpoint. E.g.
44       'ci-overcloud.ctlplane.tripleo.org'.
45     type: string
46
47 resources:
48
49   IncomingMetadataSettings:
50     type: OS::Heat::Value
51     properties:
52       value:
53         yaql:
54           # Filter null values and values that contain don't contain
55           # 'metadata_settings', get the values from that key and get the
56           # unique ones.
57           expression: list(coalesce($.data, []).where($ != null).where($.containsKey('metadata_settings')).metadata_settings.flatten().distinct())
58           data: {get_param: RoleData}
59
60   # Generates entries for nova metadata with the following format:
61   #   'managed_service_<id>' : <service>/<fqdn>
62   # Depending on the requested network
63   IndividualServices:
64     type: OS::Heat::Value
65     properties:
66       value:
67         yaql:
68           expression: let(fqdns => $.data.fqdns) -> dict(coalesce($.data.metadata, []).where($ != null and $.type = 'vip').select([concat('managed_service_', $.service, $.network), concat($.service, '/', $fqdns.get($.network))]))
69           data:
70             metadata: {get_attr: [IncomingMetadataSettings, value]}
71             fqdns:
72 {%- for network in networks if network.vip|default(false) %}
73 {%- if network.name == 'External' %}
74               external: {get_param: CloudName}
75 {%- elif network.name == 'InternalApi' %}
76               internal_api: {get_param: CloudNameInternal}
77 {%- elif network.name == 'StorageMgmt' %}
78               storage_mgmt: {get_param: CloudNameStorageManagement}
79 {%- else %}
80               {{network.name_lower}}: {get_param: CloudName{{network.name}}}
81 {%- endif %}
82 {%- endfor %}
83               ctlplane: {get_param: CloudNameCtlplane}
84
85   CompactServices:
86     type: OS::Heat::Value
87     properties:
88       value:
89         yaql:
90           expression: dict(coalesce($.data, []).where($ != null and $.type = 'node').select([$.service, $.network.replace('_', '')]).groupBy($[0], $[1]))
91           data: {get_attr: [IncomingMetadataSettings, value]}
92
93 outputs:
94   metadata:
95     description: actual metadata entries that will be passed to the server.
96     value:
97       map_merge:
98         - {get_attr: [IndividualServices, value]}
99         - compact_services: {get_attr: [CompactServices, value]}
100