Merge "Fixes port binding controller for OpenDaylight"
[apex-tripleo-heat-templates.git] / puppet / services / gnocchi-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   Gnocchi 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   GnocchiPassword:
22     description: The password for the gnocchi service and db account.
23     type: string
24     hidden: true
25   GnocchiBackend:
26     default: swift
27     description: The short name of the Gnocchi backend to use. Should be one
28       of swift, rbd, or file
29     type: string
30     constraints:
31     - allowed_values: ['swift', 'file', 'rbd']
32   KeystoneRegion:
33     type: string
34     default: 'regionOne'
35     description: Keystone region for endpoint
36   MonitoringSubscriptionGnocchiApi:
37     default: 'overcloud-gnocchi-api'
38     type: string
39   GnocchiApiLoggingSource:
40     type: json
41     default:
42       tag: openstack.gnocchi.api
43       path: /var/log/gnocchi/app.log
44   EnableInternalTLS:
45     type: boolean
46     default: false
47   GnocchiApiPolicies:
48     description: |
49       A hash of policies to configure for Gnocchi API.
50       e.g. { gnocchi-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
51     default: {}
52     type: json
53
54 resources:
55
56   GnocchiServiceBase:
57     type: ./gnocchi-base.yaml
58     properties:
59       ServiceNetMap: {get_param: ServiceNetMap}
60       DefaultPasswords: {get_param: DefaultPasswords}
61       EndpointMap: {get_param: EndpointMap}
62
63   ApacheServiceBase:
64     type: ./apache.yaml
65     properties:
66       ServiceNetMap: {get_param: ServiceNetMap}
67       DefaultPasswords: {get_param: DefaultPasswords}
68       EndpointMap: {get_param: EndpointMap}
69       EnableInternalTLS: {get_param: EnableInternalTLS}
70
71 outputs:
72   role_data:
73     description: Role data for the Gnocchi role.
74     value:
75       service_name: gnocchi_api
76       monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiApi}
77       logging_source: {get_param: GnocchiApiLoggingSource}
78       logging_groups:
79         - gnocchi
80       config_settings:
81         map_merge:
82           - get_attr: [ApacheServiceBase, role_data, config_settings]
83           - get_attr: [GnocchiServiceBase, role_data, config_settings]
84           - tripleo.gnocchi_api.firewall_rules:
85               '129 gnocchi-api':
86                 dport:
87                   - 8041
88                   - 13041
89             gnocchi::api::enabled: true
90             gnocchi::api::enable_proxy_headers_parsing: true
91             gnocchi::api::service_name: 'httpd'
92             gnocchi::policy::policies: {get_param: GnocchiApiPolicies}
93             gnocchi::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
94             gnocchi::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
95             gnocchi::keystone::authtoken::password: {get_param: GnocchiPassword}
96             gnocchi::keystone::authtoken::project_name: 'service'
97             gnocchi::keystone::authtoken::user_domain_name: 'Default'
98             gnocchi::keystone::authtoken::project_domain_name: 'Default'
99             gnocchi::wsgi::apache::ssl: {get_param: EnableInternalTLS}
100             gnocchi::wsgi::apache::servername:
101               str_replace:
102                 template:
103                   "%{hiera('fqdn_$NETWORK')}"
104                 params:
105                   $NETWORK: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
106             tripleo::profile::base::gnocchi::api::gnocchi_backend: {get_param: GnocchiBackend}
107             # NOTE: bind IP is found in Heat replacing the network name with the
108             # local node IP for the given network; replacement examples
109             # (eg. for internal_api):
110             # internal_api -> IP
111             # internal_api_uri -> [IP]
112             # internal_api_subnet - > IP/CIDR
113             gnocchi::wsgi::apache::bind_host: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
114             gnocchi::wsgi::apache::wsgi_process_display_name: 'gnocchi_wsgi'
115       step_config: |
116         include ::tripleo::profile::base::gnocchi::api
117       service_config_settings:
118         keystone:
119           gnocchi::keystone::auth::admin_url: { get_param: [ EndpointMap, GnocchiAdmin, uri ] }
120           gnocchi::keystone::auth::internal_url: {get_param: [EndpointMap, GnocchiInternal, uri]}
121           gnocchi::keystone::auth::password: {get_param: GnocchiPassword}
122           gnocchi::keystone::auth::public_url: { get_param: [ EndpointMap, GnocchiPublic, uri ] }
123           gnocchi::keystone::auth::region: {get_param: KeystoneRegion}
124           gnocchi::keystone::auth::tenant: 'service'
125         mysql:
126           gnocchi::db::mysql::password: {get_param: GnocchiPassword}
127           gnocchi::db::mysql::user: gnocchi
128           gnocchi::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
129           gnocchi::db::mysql::dbname: gnocchi
130           gnocchi::db::mysql::allowed_hosts:
131             - '%'
132             - "%{hiera('mysql_bind_host')}"
133       metadata_settings:
134         get_attr: [ApacheServiceBase, role_data, metadata_settings]
135       upgrade_tasks:
136         - name: Stop gnocchi_api service (running under httpd)
137           tags: step1
138           service: name=httpd state=stopped