Merge "Add IPv6 disable option"
[apex-tripleo-heat-templates.git] / extraconfig / nova_metadata / krb-service-principals.yaml
1 heat_template_version: ocata
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
9   # Coming from parameter_defaults
10   CloudName:
11     default: overcloud.localdomain
12     description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
13     type: string
14   CloudNameInternal:
15     default: overcloud.internalapi.localdomain
16     description: >
17       The DNS name of this cloud's internal API endpoint. E.g.
18       'ci-overcloud.internalapi.tripleo.org'.
19     type: string
20   CloudNameStorage:
21     default: overcloud.storage.localdomain
22     description: >
23       The DNS name of this cloud's storage endpoint. E.g.
24       'ci-overcloud.storage.tripleo.org'.
25     type: string
26   CloudNameStorageManagement:
27     default: overcloud.storagemgmt.localdomain
28     description: >
29       The DNS name of this cloud's storage management endpoint. E.g.
30       'ci-overcloud.storagemgmt.tripleo.org'.
31     type: string
32   CloudNameCtlplane:
33     default: overcloud.ctlplane.localdomain
34     description: >
35       The DNS name of this cloud's storage management endpoint. E.g.
36       'ci-overcloud.management.tripleo.org'.
37     type: string
38
39 resources:
40
41   IncomingMetadataSettings:
42     type: OS::Heat::Value
43     properties:
44       value:
45         yaql:
46           # Filter null values and values that contain don't contain
47           # 'metadata_settings', get the values from that key and get the
48           # unique ones.
49           expression: list(coalesce($.data, []).where($ != null).where($.containsKey('metadata_settings')).metadata_settings.flatten().distinct())
50           data: {get_param: RoleData}
51
52   # Generates entries for nova metadata with the following format:
53   #   'managed_service_<id>' : <service>/<fqdn>
54   # Depending on the requested network
55   IndividualServices:
56     type: OS::Heat::Value
57     properties:
58       value:
59         yaql:
60           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))]))
61           data:
62             metadata: {get_attr: [IncomingMetadataSettings, value]}
63             fqdns:
64               external: {get_param: CloudName}
65               internal_api: {get_param: CloudNameInternal}
66               storage: {get_param: CloudNameStorage}
67               storage_mgmt: {get_param: CloudNameStorageManagement}
68               ctlplane: {get_param: CloudNameCtlplane}
69
70   CompactServices:
71     type: OS::Heat::Value
72     properties:
73       value:
74         yaql:
75           expression: dict(coalesce($.data, []).where($ != null and $.type = 'node').select([$.service, $.network.replace('_', '')]).groupBy($[0], $[1]))
76           data: {get_attr: [IncomingMetadataSettings, value]}
77
78 outputs:
79   metadata:
80     description: actual metadata entries that will be passed to the server.
81     value:
82       map_merge:
83         - {get_attr: [IndividualServices, value]}
84         - compact_services: {get_attr: [CompactServices, value]}