Merge "Describe use of Manila/CephFS in capabilites_map"
[apex-tripleo-heat-templates.git] / puppet / services / services.yaml
1 heat_template_version: ocata
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
30 resources:
31
32   ServiceChain:
33     type: OS::Heat::ResourceChain
34     properties:
35       resources: {get_param: Services}
36       concurrent: true
37       resource_properties:
38         ServiceNetMap: {get_param: ServiceNetMap}
39         EndpointMap: {get_param: EndpointMap}
40         DefaultPasswords: {get_param: DefaultPasswords}
41
42   LoggingConfiguration:
43     type: OS::TripleO::LoggingConfiguration
44
45   ServiceServerMetadataHook:
46     type: OS::TripleO::ServiceServerMetadataHook
47     properties:
48       RoleData: {get_attr: [ServiceChain, role_data]}
49
50 outputs:
51   role_data:
52     description: Combined Role data for this set of services.
53     value:
54       service_names:
55         # Filter any null/None service_names which may be present due to mapping
56         # of services to OS::Heat::None
57         yaql:
58           expression: list($.data.s_names.where($ != null))
59           data: {s_names: {get_attr: [ServiceChain, role_data, service_name]}}
60       monitoring_subscriptions:
61         yaql:
62           expression: list($.data.role_data.where($ != null).select($.get('monitoring_subscription')).where($ != null))
63           data: {role_data: {get_attr: [ServiceChain, role_data]}}
64       logging_sources:
65         # Transform the individual logging_source configuration from
66         # each service in the chain into a global list, adding some
67         # default configuration at the same time.
68         yaql:
69           expression: >
70             let(
71             default_format => $.data.default_format,
72             pos_file_path => $.data.pos_file_path,
73             sources => $.data.sources.flatten()
74             ) ->
75             $sources.where($ != null).select({
76             'type' => 'tail',
77             'tag' => $.tag,
78             'path' => $.path,
79             'format' => $.get('format', $default_format),
80             'pos_file' => $.get('pos_file', $pos_file_path + '/' + $.tag + '.pos')
81             })
82           data:
83             sources:
84               - {get_attr: [LoggingConfiguration, LoggingDefaultSources]}
85               - yaql:
86                   expression: list($.data.role_data.where($ != null).select($.get('logging_source')).where($ != null))
87                   data: {role_data: {get_attr: [ServiceChain, role_data]}}
88
89               - {get_attr: [LoggingConfiguration, LoggingExtraSources]}
90             default_format: {get_attr: [LoggingConfiguration, LoggingDefaultFormat]}
91             pos_file_path: {get_attr: [LoggingConfiguration, LoggingPosFilePath]}
92       logging_groups:
93         # Build a list of unique groups to which we should add the
94         # fluentd user.
95         yaql:
96           expression: >
97             set($.data.groups.flatten()).where($)
98           data:
99             groups:
100               - [{get_attr: [LoggingConfiguration, LoggingDefaultGroups]}]
101               - yaql:
102                   expression: list($.data.role_data.where($ != null).select($.get('logging_groups')).where($ != null))
103                   data: {role_data: {get_attr: [ServiceChain, role_data]}}
104               - [{get_attr: [LoggingConfiguration, LoggingExtraGroups]}]
105       config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}}
106       global_config_settings:
107         map_merge:
108           yaql:
109             expression: list($.data.role_data.where($ != null).select($.get('global_config_settings')).where($ != null))
110             data: {role_data: {get_attr: [ServiceChain, role_data]}}
111       service_config_settings:
112         yaql:
113           expression: $.data.role_data.where($ != null).select($.get('service_config_settings')).where($ != null).reduce($1.mergeWith($2), {})
114           data: {role_data: {get_attr: [ServiceChain, role_data]}}
115       step_config: {list_join: ["\n", {get_attr: [ServiceChain, role_data, step_config]}]}
116       upgrade_tasks:
117         yaql:
118           # Note we use distinct() here to filter any identical tasks, e.g yum update for all services
119           expression: $.data.where($ != null).select($.get('upgrade_tasks')).where($ != null).flatten().distinct()
120           data: {get_attr: [ServiceChain, role_data]}
121       upgrade_batch_tasks:
122         yaql:
123           # Note we use distinct() here to filter any identical tasks, e.g yum update for all services
124           expression: $.data.where($ != null).select($.get('upgrade_batch_tasks')).where($ != null).flatten().distinct()
125           data: {get_attr: [ServiceChain, role_data]}
126       service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]}