Merge "Add composable services for the Veritas HyperScale."
[apex-tripleo-heat-templates.git] / puppet / services / aodh-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Aodh API service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   MonitoringSubscriptionAodhApi:
34     default: 'overcloud-ceilometer-aodh-api'
35     type: string
36   EnableInternalTLS:
37     type: boolean
38     default: false
39   AodhApiPolicies:
40     description: |
41       A hash of policies to configure for Aodh API.
42       e.g. { aodh-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
43     default: {}
44     type: json
45
46 resources:
47   AodhBase:
48     type: ./aodh-base.yaml
49     properties:
50       ServiceData: {get_param: ServiceData}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       EndpointMap: {get_param: EndpointMap}
54       RoleName: {get_param: RoleName}
55       RoleParameters: {get_param: RoleParameters}
56
57   ApacheServiceBase:
58     type: ./apache.yaml
59     properties:
60       ServiceData: {get_param: ServiceData}
61       ServiceNetMap: {get_param: ServiceNetMap}
62       DefaultPasswords: {get_param: DefaultPasswords}
63       EndpointMap: {get_param: EndpointMap}
64       RoleName: {get_param: RoleName}
65       RoleParameters: {get_param: RoleParameters}
66       EnableInternalTLS: {get_param: EnableInternalTLS}
67
68 outputs:
69   role_data:
70     description: Role data for the Aodh API service.
71     value:
72       service_name: aodh_api
73       monitoring_subscription: {get_param: MonitoringSubscriptionAodhApi}
74       config_settings:
75         map_merge:
76           - get_attr: [AodhBase, role_data, config_settings]
77           - get_attr: [ApacheServiceBase, role_data, config_settings]
78           - aodh::wsgi::apache::ssl: {get_param: EnableInternalTLS}
79             aodh::wsgi::apache::servername:
80               str_replace:
81                 template:
82                   "%{hiera('fqdn_$NETWORK')}"
83                 params:
84                   $NETWORK: {get_param: [ServiceNetMap, AodhApiNetwork]}
85             aodh::wsgi::apache::wsgi_process_display_name: 'aodh_wsgi'
86             aodh::api::service_name: 'httpd'
87             aodh::api::enable_proxy_headers_parsing: true
88             aodh::policy::policies: {get_param: AodhApiPolicies}
89             tripleo.aodh_api.firewall_rules:
90               '128 aodh-api':
91                 dport:
92                   - 8042
93                   - 13042
94             aodh::api::host:
95               str_replace:
96                 template:
97                   "%{hiera('fqdn_$NETWORK')}"
98                 params:
99                   $NETWORK: {get_param: [ServiceNetMap, AodhApiNetwork]}
100             # NOTE: bind IP is found in Heat replacing the network name with the
101             # local node IP for the given network; replacement examples
102             # (eg. for internal_api):
103             # internal_api -> IP
104             # internal_api_uri -> [IP]
105             # internal_api_subnet - > IP/CIDR
106             aodh::wsgi::apache::bind_host: {get_param: [ServiceNetMap, AodhApiNetwork]}
107       service_config_settings:
108         get_attr: [AodhBase, role_data, service_config_settings]
109       step_config: |
110         include tripleo::profile::base::aodh::api
111       metadata_settings:
112         get_attr: [ApacheServiceBase, role_data, metadata_settings]
113       upgrade_tasks:
114         yaql:
115           expression: $.data.apache_upgrade + $.data.aodh_api_upgrade
116           data:
117             apache_upgrade:
118               get_attr: [ApacheServiceBase, role_data, upgrade_tasks]
119             aodh_api_upgrade:
120               - name: Stop aodh_api service (running under httpd)
121                 tags: step1
122                 service: name=httpd state=stopped