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