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