Update the template_version alias for all the templates to pike.
[apex-tripleo-heat-templates.git] / puppet / services / services.yaml
1 heat_template_version: pike
2
3 description: >
4   Utility stack to convert an array of services into a set of combined
5   role configs.
6
7 parameters:
8   Services:
9     default: []
10     description: |
11         List nested stack service templates.
12     type: comma_delimited_list
13   ServiceNetMap:
14     default: {}
15     description: Mapping of service_name -> network name. Typically set
16                  via parameter_defaults in the resource registry.  This
17                  mapping overrides those in ServiceNetMapDefaults.
18     type: json
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   DefaultPasswords:
25     default: {}
26     description: Mapping of service -> default password. Used to help
27                  pass top level passwords managed by Heat into services.
28     type: json
29   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     description: Role Specific parameters to be provided to service
35     default: {}
36     type: json
37
38 resources:
39
40   ServiceChain:
41     type: OS::Heat::ResourceChain
42     properties:
43       resources: {get_param: Services}
44       concurrent: true
45       resource_properties:
46         ServiceNetMap: {get_param: ServiceNetMap}
47         EndpointMap: {get_param: EndpointMap}
48         DefaultPasswords: {get_param: DefaultPasswords}
49         RoleName: {get_param: RoleName}
50         RoleParameters: {get_param: RoleParameters}
51
52   LoggingConfiguration:
53     type: OS::TripleO::LoggingConfiguration
54
55   ServiceServerMetadataHook:
56     type: OS::TripleO::ServiceServerMetadataHook
57     properties:
58       RoleData: {get_attr: [ServiceChain, role_data]}
59
60 outputs:
61   role_data:
62     description: Combined Role data for this set of services.
63     value:
64       service_names:
65         {get_attr: [ServiceChain, role_data, service_name]}
66       monitoring_subscriptions:
67         yaql:
68           expression: list($.data.role_data.where($ != null).select($.get('monitoring_subscription')).where($ != null))
69           data: {role_data: {get_attr: [ServiceChain, role_data]}}
70       logging_sources:
71         # Transform the individual logging_source configuration from
72         # each service in the chain into a global list, adding some
73         # default configuration at the same time.
74         yaql:
75           expression: >
76             let(
77             default_format => $.data.default_format,
78             pos_file_path => $.data.pos_file_path,
79             sources => $.data.sources.flatten()
80             ) ->
81             $sources.where($ != null).select({
82             'type' => 'tail',
83             'tag' => $.tag,
84             'path' => $.path,
85             'format' => $.get('format', $default_format),
86             'pos_file' => $.get('pos_file', $pos_file_path + '/' + $.tag + '.pos')
87             })
88           data:
89             sources:
90               - {get_attr: [LoggingConfiguration, LoggingDefaultSources]}
91               - yaql:
92                   expression: list($.data.role_data.where($ != null).select($.get('logging_source')).where($ != null))
93                   data: {role_data: {get_attr: [ServiceChain, role_data]}}
94
95               - {get_attr: [LoggingConfiguration, LoggingExtraSources]}
96             default_format: {get_attr: [LoggingConfiguration, LoggingDefaultFormat]}
97             pos_file_path: {get_attr: [LoggingConfiguration, LoggingPosFilePath]}
98       logging_groups:
99         # Build a list of unique groups to which we should add the
100         # fluentd user.
101         yaql:
102           expression: >
103             set(($.data.default + $.data.extra + $.data.role_data.where($ != null).select($.get('logging_groups'))).flatten()).where($)
104           data:
105             default: {get_attr: [LoggingConfiguration, LoggingDefaultGroups]}
106             extra: {get_attr: [LoggingConfiguration, LoggingExtraGroups]}
107             role_data: {get_attr: [ServiceChain, role_data]}
108       config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}}
109       global_config_settings:
110         map_merge:
111           yaql:
112             expression: list($.data.role_data.where($ != null).select($.get('global_config_settings')).where($ != null))
113             data: {role_data: {get_attr: [ServiceChain, role_data]}}
114       service_config_settings:
115         yaql:
116           expression: $.data.role_data.where($ != null).select($.get('service_config_settings')).where($ != null).reduce($1.mergeWith($2), {})
117           data: {role_data: {get_attr: [ServiceChain, role_data]}}
118       step_config: {get_attr: [ServiceChain, role_data, step_config]}
119       upgrade_tasks:
120         yaql:
121           # Note we use distinct() here to filter any identical tasks, e.g yum update for all services
122           expression: $.data.where($ != null).select($.get('upgrade_tasks')).where($ != null).flatten().distinct()
123           data: {get_attr: [ServiceChain, role_data]}
124       upgrade_batch_tasks:
125         yaql:
126           # Note we use distinct() here to filter any identical tasks, e.g yum update for all services
127           expression: $.data.where($ != null).select($.get('upgrade_batch_tasks')).where($ != null).flatten().distinct()
128           data: {get_attr: [ServiceChain, role_data]}
129       service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]}