Add option to disable "d1" Swift device
[apex-tripleo-heat-templates.git] / puppet / services / cinder-api.yaml
1 heat_template_version: 2016-10-14
2
3 description: >
4   OpenStack Cinder API service configured with Puppet
5
6 parameters:
7   CinderEnableDBPurge:
8     default: true
9     description: |
10       Whether to create cron job for purging soft deleted rows in Cinder database.
11     type: boolean
12   CinderPassword:
13     description: The password for the cinder service account, used by cinder-api.
14     type: string
15     hidden: true
16   ServiceNetMap:
17     default: {}
18     description: Mapping of service_name -> network name. Typically set
19                  via parameter_defaults in the resource registry.  This
20                  mapping overrides those in ServiceNetMapDefaults.
21     type: json
22   DefaultPasswords:
23     default: {}
24     type: json
25   EndpointMap:
26     default: {}
27     description: Mapping of service endpoint -> protocol. Typically set
28                  via parameter_defaults in the resource registry.
29     type: json
30   KeystoneRegion:
31     type: string
32     default: 'regionOne'
33     description: Keystone region for endpoint
34   MonitoringSubscriptionCinderApi:
35     default: 'overcloud-cinder-api'
36     type: string
37   CinderApiLoggingSource:
38     type: json
39     default:
40       tag: openstack.cinder.api
41       path: /var/log/cinder/cinder-api.log
42   CinderWorkers:
43     type: string
44     description: Set the number of workers for cinder::wsgi::apache
45     default: '"%{::os_workers}"'
46
47 conditions:
48   cinder_workers_zero: {equals : [{get_param: CinderWorkers}, 0]}
49
50 resources:
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
59   CinderBase:
60     type: ./cinder-base.yaml
61     properties:
62       ServiceNetMap: {get_param: ServiceNetMap}
63       DefaultPasswords: {get_param: DefaultPasswords}
64       EndpointMap: {get_param: EndpointMap}
65
66 outputs:
67   role_data:
68     description: Role data for the Cinder API role.
69     value:
70       service_name: cinder_api
71       monitoring_subscription: {get_param: MonitoringSubscriptionCinderApi}
72       logging_source: {get_param: CinderApiLoggingSource}
73       logging_groups:
74         - cinder
75       config_settings:
76         map_merge:
77           - get_attr: [CinderBase, role_data, config_settings]
78           - get_attr: [ApacheServiceBase, role_data, config_settings]
79           - cinder::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
80             cinder::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
81             cinder::keystone::authtoken::password: {get_param: CinderPassword}
82             cinder::keystone::authtoken::project_name: 'service'
83             cinder::api::enable_proxy_headers_parsing: true
84
85             cinder::api::nova_catalog_info: 'compute:Compute Service:internalURL'
86             # TODO(emilien) move it to puppet-cinder
87             cinder::config:
88               DEFAULT/swift_catalog_info:
89                 value: 'object-store:swift:internalURL'
90             cinder::glance::glance_api_servers: {get_param: [EndpointMap, GlanceInternal, uri]}
91             tripleo::profile::base::cinder::cinder_enable_db_purge: {get_param: CinderEnableDBPurge}
92             tripleo.cinder_api.firewall_rules:
93               '119 cinder':
94                 dport:
95                   - 8776
96                   - 13776
97             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
98             # for the given network; replacement examples (eg. for internal_api):
99             # internal_api -> IP
100             # internal_api_uri -> [IP]
101             # internal_api_subnet - > IP/CIDR
102             cinder::api::bind_host: {get_param: [ServiceNetMap, CinderApiNetwork]}
103             cinder::wsgi::apache::ssl: false
104             cinder::wsgi::apache::bind_host: {get_param: [ServiceNetMap, CinderApiNetwork]}
105             cinder::wsgi::apache::servername:
106               str_replace:
107                 template:
108                   '"%{::fqdn_$NETWORK}"'
109                 params:
110                   $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
111           -
112             if:
113             - cinder_workers_zero
114             - {}
115             - cinder::wsgi::apache::workers: {get_param: CinderWorkers}
116       step_config: |
117         include ::tripleo::profile::base::cinder::api
118       service_config_settings:
119         keystone:
120           cinder::keystone::auth::tenant: 'service'
121           cinder::keystone::auth::public_url: {get_param: [EndpointMap, CinderPublic, uri]}
122           cinder::keystone::auth::internal_url: {get_param: [EndpointMap, CinderInternal, uri]}
123           cinder::keystone::auth::admin_url: {get_param: [EndpointMap, CinderAdmin, uri]}
124           cinder::keystone::auth::public_url_v2: {get_param: [EndpointMap, CinderV2Public, uri]}
125           cinder::keystone::auth::internal_url_v2: {get_param: [EndpointMap, CinderV2Internal, uri]}
126           cinder::keystone::auth::admin_url_v2: {get_param: [EndpointMap, CinderV2Admin, uri]}
127           cinder::keystone::auth::public_url_v3: {get_param: [EndpointMap, CinderV3Public, uri]}
128           cinder::keystone::auth::internal_url_v3: {get_param: [EndpointMap, CinderV3Internal, uri]}
129           cinder::keystone::auth::admin_url_v3: {get_param: [EndpointMap, CinderV3Admin, uri]}
130           cinder::keystone::auth::password: {get_param: CinderPassword}
131           cinder::keystone::auth::region: {get_param: KeystoneRegion}
132         mysql:
133           cinder::db::mysql::password: {get_param: CinderPassword}
134           cinder::db::mysql::user: cinder
135           cinder::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
136           cinder::db::mysql::dbname: cinder
137           cinder::db::mysql::allowed_hosts:
138             - '%'
139             - "%{hiera('mysql_bind_host')}"