2017-06-08 19:07:51 +01:00
|
|
|
#FIXME move into common when specfile adds it
|
2017-02-17 11:12:36 +01:00
|
|
|
heat_template_version: pike
|
2016-03-15 10:49:30 -04:00
|
|
|
|
|
|
|
description: >
|
|
|
|
Utility stack to convert an array of services into a set of combined
|
|
|
|
role configs.
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
Services:
|
|
|
|
default: []
|
|
|
|
description: |
|
|
|
|
List nested stack service templates.
|
|
|
|
type: comma_delimited_list
|
2016-08-11 23:07:46 +02:00
|
|
|
ServiceNetMap:
|
|
|
|
default: {}
|
|
|
|
description: Mapping of service_name -> network name. Typically set
|
|
|
|
via parameter_defaults in the resource registry. This
|
|
|
|
mapping overrides those in ServiceNetMapDefaults.
|
|
|
|
type: json
|
2016-03-15 10:49:30 -04:00
|
|
|
EndpointMap:
|
|
|
|
default: {}
|
|
|
|
description: Mapping of service endpoint -> protocol. Typically set
|
|
|
|
via parameter_defaults in the resource registry.
|
|
|
|
type: json
|
2016-08-17 09:26:05 -04:00
|
|
|
DefaultPasswords:
|
|
|
|
default: {}
|
|
|
|
description: Mapping of service -> default password. Used to help
|
|
|
|
pass top level passwords managed by Heat into services.
|
|
|
|
type: json
|
2017-02-24 06:27:58 -05:00
|
|
|
RoleName:
|
|
|
|
default: ''
|
|
|
|
description: Role name on which the service is applied
|
|
|
|
type: string
|
|
|
|
RoleParameters:
|
|
|
|
description: Role Specific parameters to be provided to service
|
|
|
|
default: {}
|
|
|
|
type: json
|
2016-03-15 10:49:30 -04:00
|
|
|
|
|
|
|
resources:
|
|
|
|
|
|
|
|
ServiceChain:
|
|
|
|
type: OS::Heat::ResourceChain
|
|
|
|
properties:
|
|
|
|
resources: {get_param: Services}
|
|
|
|
concurrent: true
|
|
|
|
resource_properties:
|
2016-08-11 23:07:46 +02:00
|
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
2016-03-15 10:49:30 -04:00
|
|
|
EndpointMap: {get_param: EndpointMap}
|
2016-08-17 09:26:05 -04:00
|
|
|
DefaultPasswords: {get_param: DefaultPasswords}
|
2017-02-24 06:27:58 -05:00
|
|
|
RoleName: {get_param: RoleName}
|
|
|
|
RoleParameters: {get_param: RoleParameters}
|
2016-03-15 10:49:30 -04:00
|
|
|
|
2016-08-09 16:20:18 -04:00
|
|
|
LoggingConfiguration:
|
|
|
|
type: OS::TripleO::LoggingConfiguration
|
|
|
|
|
2016-12-15 14:28:57 +02:00
|
|
|
ServiceServerMetadataHook:
|
|
|
|
type: OS::TripleO::ServiceServerMetadataHook
|
|
|
|
properties:
|
|
|
|
RoleData: {get_attr: [ServiceChain, role_data]}
|
|
|
|
|
2016-03-15 10:49:30 -04:00
|
|
|
outputs:
|
2016-06-22 11:11:40 -04:00
|
|
|
role_data:
|
|
|
|
description: Combined Role data for this set of services.
|
|
|
|
value:
|
2016-07-27 11:51:30 +01:00
|
|
|
service_names:
|
2017-01-03 22:21:44 -05:00
|
|
|
{get_attr: [ServiceChain, role_data, service_name]}
|
2016-06-09 15:39:22 +02:00
|
|
|
monitoring_subscriptions:
|
|
|
|
yaql:
|
2016-11-10 07:42:13 -05:00
|
|
|
expression: list($.data.role_data.where($ != null).select($.get('monitoring_subscription')).where($ != null))
|
|
|
|
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
2016-08-09 16:20:18 -04:00
|
|
|
logging_sources:
|
|
|
|
# Transform the individual logging_source configuration from
|
|
|
|
# each service in the chain into a global list, adding some
|
|
|
|
# default configuration at the same time.
|
|
|
|
yaql:
|
|
|
|
expression: >
|
|
|
|
let(
|
|
|
|
default_format => $.data.default_format,
|
|
|
|
pos_file_path => $.data.pos_file_path,
|
|
|
|
sources => $.data.sources.flatten()
|
|
|
|
) ->
|
|
|
|
$sources.where($ != null).select({
|
|
|
|
'type' => 'tail',
|
|
|
|
'tag' => $.tag,
|
|
|
|
'path' => $.path,
|
|
|
|
'format' => $.get('format', $default_format),
|
|
|
|
'pos_file' => $.get('pos_file', $pos_file_path + '/' + $.tag + '.pos')
|
|
|
|
})
|
|
|
|
data:
|
|
|
|
sources:
|
|
|
|
- {get_attr: [LoggingConfiguration, LoggingDefaultSources]}
|
2016-09-21 14:42:52 +01:00
|
|
|
- yaql:
|
2016-11-10 07:42:13 -05:00
|
|
|
expression: list($.data.role_data.where($ != null).select($.get('logging_source')).where($ != null))
|
|
|
|
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
|
|
|
|
2016-08-09 16:20:18 -04:00
|
|
|
- {get_attr: [LoggingConfiguration, LoggingExtraSources]}
|
|
|
|
default_format: {get_attr: [LoggingConfiguration, LoggingDefaultFormat]}
|
|
|
|
pos_file_path: {get_attr: [LoggingConfiguration, LoggingPosFilePath]}
|
|
|
|
logging_groups:
|
|
|
|
# Build a list of unique groups to which we should add the
|
|
|
|
# fluentd user.
|
|
|
|
yaql:
|
|
|
|
expression: >
|
2017-03-20 18:07:37 +01:00
|
|
|
set(($.data.default + $.data.extra + $.data.role_data.where($ != null).select($.get('logging_groups'))).flatten()).where($)
|
2016-08-09 16:20:18 -04:00
|
|
|
data:
|
2017-03-20 18:07:37 +01:00
|
|
|
default: {get_attr: [LoggingConfiguration, LoggingDefaultGroups]}
|
|
|
|
extra: {get_attr: [LoggingConfiguration, LoggingExtraGroups]}
|
|
|
|
role_data: {get_attr: [ServiceChain, role_data]}
|
2016-06-22 11:11:40 -04:00
|
|
|
config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}}
|
2016-07-01 14:45:31 +02:00
|
|
|
global_config_settings:
|
|
|
|
map_merge:
|
|
|
|
yaql:
|
2016-11-10 07:42:13 -05:00
|
|
|
expression: list($.data.role_data.where($ != null).select($.get('global_config_settings')).where($ != null))
|
|
|
|
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
2016-09-15 09:19:15 +02:00
|
|
|
service_config_settings:
|
|
|
|
yaql:
|
2016-11-10 07:42:13 -05:00
|
|
|
expression: $.data.role_data.where($ != null).select($.get('service_config_settings')).where($ != null).reduce($1.mergeWith($2), {})
|
|
|
|
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
2017-01-03 22:21:44 -05:00
|
|
|
step_config: {get_attr: [ServiceChain, role_data, step_config]}
|
2016-12-01 10:00:57 +00:00
|
|
|
upgrade_tasks:
|
|
|
|
yaql:
|
|
|
|
# Note we use distinct() here to filter any identical tasks, e.g yum update for all services
|
|
|
|
expression: $.data.where($ != null).select($.get('upgrade_tasks')).where($ != null).flatten().distinct()
|
|
|
|
data: {get_attr: [ServiceChain, role_data]}
|
2017-01-20 10:45:19 +00:00
|
|
|
upgrade_batch_tasks:
|
|
|
|
yaql:
|
|
|
|
# Note we use distinct() here to filter any identical tasks, e.g yum update for all services
|
|
|
|
expression: $.data.where($ != null).select($.get('upgrade_batch_tasks')).where($ != null).flatten().distinct()
|
|
|
|
data: {get_attr: [ServiceChain, role_data]}
|
2016-12-15 14:28:57 +02:00
|
|
|
service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]}
|
2017-06-08 19:07:51 +01:00
|
|
|
|
|
|
|
# Keys to support docker/services
|
|
|
|
puppet_config: {get_attr: [ServiceChain, role_data, puppet_config]}
|
|
|
|
kolla_config:
|
|
|
|
map_merge: {get_attr: [ServiceChain, role_data, kolla_config]}
|
|
|
|
docker_config:
|
|
|
|
{get_attr: [ServiceChain, role_data, docker_config]}
|
|
|
|
docker_puppet_tasks:
|
|
|
|
{get_attr: [ServiceChain, role_data, docker_puppet_tasks]}
|
|
|
|
host_prep_tasks:
|
|
|
|
yaql:
|
|
|
|
# Note we use distinct() here to filter any identical tasks
|
|
|
|
expression: $.data.where($ != null).select($.get('host_prep_tasks')).where($ != null).flatten().distinct()
|
|
|
|
data: {get_attr: [ServiceChain, role_data]}
|