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