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