Hiera optimization: use a new hiera hook
[apex-tripleo-heat-templates.git] / puppet / services / gnocchi-api.yaml
1 heat_template_version: 2016-04-08
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
48 resources:
49
50   GnocchiServiceBase:
51     type: ./gnocchi-base.yaml
52     properties:
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55       EndpointMap: {get_param: EndpointMap}
56
57   ApacheServiceBase:
58     type: ./apache.yaml
59     properties:
60       ServiceNetMap: {get_param: ServiceNetMap}
61       DefaultPasswords: {get_param: DefaultPasswords}
62       EndpointMap: {get_param: EndpointMap}
63       EnableInternalTLS: {get_param: EnableInternalTLS}
64
65 outputs:
66   role_data:
67     description: Role data for the Gnocchi role.
68     value:
69       service_name: gnocchi_api
70       monitoring_subscription: {get_param: MonitoringSubscriptionGnocchiApi}
71       logging_source: {get_param: GnocchiApiLoggingSource}
72       logging_groups:
73         - gnocchi
74       config_settings:
75         map_merge:
76           - get_attr: [ApacheServiceBase, role_data, config_settings]
77           - get_attr: [GnocchiServiceBase, role_data, config_settings]
78           - tripleo.gnocchi_api.firewall_rules:
79               '129 gnocchi-api':
80                 dport:
81                   - 8041
82                   - 13041
83             gnocchi::api::enabled: true
84             gnocchi::api::enable_proxy_headers_parsing: true
85             gnocchi::api::service_name: 'httpd'
86             gnocchi::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
87             gnocchi::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
88             gnocchi::keystone::authtoken::password: {get_param: GnocchiPassword}
89             gnocchi::keystone::authtoken::project_name: 'service'
90             gnocchi::wsgi::apache::ssl: {get_param: EnableInternalTLS}
91             gnocchi::wsgi::apache::servername:
92               str_replace:
93                 template:
94                   '%{::fqdn_$NETWORK}'
95                 params:
96                   $NETWORK: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
97             tripleo::profile::base::gnocchi::api::gnocchi_backend: {get_param: GnocchiBackend}
98             # NOTE: bind IP is found in Heat replacing the network name with the
99             # local node IP for the given network; replacement examples
100             # (eg. for internal_api):
101             # internal_api -> IP
102             # internal_api_uri -> [IP]
103             # internal_api_subnet - > IP/CIDR
104             gnocchi::wsgi::apache::bind_host: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
105             gnocchi::api::host:
106               str_replace:
107                 template:
108                   '%{::fqdn_$NETWORK}'
109                 params:
110                   $NETWORK: {get_param: [ServiceNetMap, GnocchiApiNetwork]}
111
112             gnocchi::api::keystone_auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
113             gnocchi::api::keystone_identity_uri: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
114             gnocchi::storage::swift::swift_authurl: {get_param: [EndpointMap, KeystoneInternal, uri]}
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')}"