heat_template_version: wallaby description: 'Generates the relevant service principals for a Standalone server' parameters: RoleData: type: json description: the list containing the 'role_data' output for the ServiceChain CloudNameStorage: default: overcloud.storage.localdomain description: > The DNS name of this cloud's storage endpoint. E.g. 'ci-overcloud.storage.tripleo.org'. type: string # Special case StorageMgmt hostname param, which is CloudNameStorageManagement CloudNameStorageManagement: default: overcloud.storagemgmt.localdomain description: > The DNS name of this cloud's storage_mgmt endpoint. E.g. 'ci-overcloud.storagemgmt.tripleo.org'. type: string # Special case the Internal API hostname param, which is CloudNameInternal CloudNameInternal: default: overcloud.internalapi.localdomain description: > The DNS name of this cloud's internal_api endpoint. E.g. 'ci-overcloud.internalapi.tripleo.org'. type: string # Special case the External hostname param, which is CloudName CloudName: default: overcloud.localdomain description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org type: string CloudNameCtlplane: default: overcloud.ctlplane.localdomain description: > The DNS name of this cloud's provisioning network endpoint. E.g. 'ci-overcloud.ctlplane.tripleo.org'. type: string resources: IncomingMetadataSettings: type: OS::Heat::Value properties: value: yaql: # Filter null values and values that contain don't contain # 'metadata_settings', get the values from that key and get the # unique ones. Also, filter values for networks not associated with # this role. expression: let(role_networks => $.data.role_networks) -> list(coalesce($.data.role_data, []).where($ != null).where($.containsKey('metadata_settings')).metadata_settings.flatten().distinct().where($ != null and $.containsKey('network')).where($role_networks.contains($.network))).flatten() data: role_data: {get_param: RoleData} role_networks: - ctlplane - storage - storage_mgmt - internal_api - tenant - external # Generates entries for nova metadata with the following format: # 'managed_service_' : / # Depending on the requested network IndividualServices: type: OS::Heat::Value properties: value: yaql: 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))])) data: metadata: {get_attr: [IncomingMetadataSettings, value]} fqdns: storage: {get_param: CloudNameStorage} storage_mgmt: {get_param: CloudNameStorageManagement} internal_api: {get_param: CloudNameInternal} external: {get_param: CloudName} ctlplane: {get_param: CloudNameCtlplane} CompactServices: type: OS::Heat::Value properties: value: yaql: expression: dict(coalesce($.data, []).where($ != null and $.type = 'node').groupBy(concat('compact_service_', $.service), $.network.replace('_', ''))) data: {get_attr: [IncomingMetadataSettings, value]} outputs: metadata: description: actual metadata entries that will be passed to the server. value: map_merge: - {get_attr: [IndividualServices, value]} - {get_attr: [CompactServices, value]}