Merge "CI/scenarios: set NotificationDriver to 'noop'"
[apex-tripleo-heat-templates.git] / puppet / services / keystone.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Keystone service configured with Puppet
5
6 parameters:
7   KeystoneEnableDBPurge:
8     default: true
9     description: |
10         Whether to create cron job for purging soft deleted rows in Keystone database.
11     type: boolean
12   KeystoneSSLCertificate:
13     default: ''
14     description: Keystone certificate for verifying token validity.
15     type: string
16   KeystoneSSLCertificateKey:
17     default: ''
18     description: Keystone key for signing tokens.
19     type: string
20     hidden: true
21   KeystoneNotificationDriver:
22     description: Comma-separated list of Oslo notification drivers used by Keystone
23     default: ['messaging']
24     type: comma_delimited_list
25   KeystoneNotificationFormat:
26     description: The Keystone notification format
27     default: 'basic'
28     type: string
29     constraints:
30       - allowed_values: [ 'basic', 'cadf' ]
31   KeystoneRegion:
32     type: string
33     default: 'regionOne'
34     description: Keystone region for endpoint
35   KeystoneTokenProvider:
36     description: The keystone token format
37     type: string
38     default: 'fernet'
39     constraints:
40       - allowed_values: ['uuid', 'fernet']
41   ServiceData:
42     default: {}
43     description: Dictionary packing service data
44     type: json
45   ServiceNetMap:
46     default: {}
47     description: Mapping of service_name -> network name. Typically set
48                  via parameter_defaults in the resource registry.  This
49                  mapping overrides those in ServiceNetMapDefaults.
50     type: json
51   DefaultPasswords:
52     default: {}
53     type: json
54   RoleName:
55     default: ''
56     description: Role name on which the service is applied
57     type: string
58   RoleParameters:
59     default: {}
60     description: Parameters specific to the role
61     type: json
62   EndpointMap:
63     default: {}
64     description: Mapping of service endpoint -> protocol. Typically set
65                  via parameter_defaults in the resource registry.
66     type: json
67   Debug:
68     type: string
69     default: ''
70   KeystoneDebug:
71     default: ''
72     description: Set to True to enable debugging Keystone service.
73     type: string
74   AdminEmail:
75     default: 'admin@example.com'
76     description: The email for the keystone admin account.
77     type: string
78     hidden: true
79   AdminPassword:
80     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
81     type: string
82     hidden: true
83   AdminToken:
84     description: The keystone auth secret and db password.
85     type: string
86     hidden: true
87   RabbitPassword:
88     description: The password for RabbitMQ
89     type: string
90     hidden: true
91   RabbitUserName:
92     default: guest
93     description: The username for RabbitMQ
94     type: string
95   RabbitClientUseSSL:
96     default: false
97     description: >
98         Rabbit client subscriber parameter to specify
99         an SSL connection to the RabbitMQ host.
100     type: string
101   RabbitClientPort:
102     default: 5672
103     description: Set rabbit subscriber port, change this if using SSL
104     type: number
105   KeystoneWorkers:
106     type: string
107     description: Set the number of workers for keystone::wsgi::apache
108     default: '%{::os_workers}'
109   MonitoringSubscriptionKeystone:
110     default: 'overcloud-keystone'
111     type: string
112   KeystoneCredential0:
113     type: string
114     description: The first Keystone credential key. Must be a valid key.
115   KeystoneCredential1:
116     type: string
117     description: The second Keystone credential key. Must be a valid key.
118   KeystoneFernetKey0:
119     type: string
120     default: ''
121     description: (DEPRECATED) The first Keystone fernet key. Must be a valid key.
122   KeystoneFernetKey1:
123     type: string
124     default: ''
125     description: (DEPRECATED) The second Keystone fernet key. Must be a valid key.
126   KeystoneFernetKeys:
127     type: json
128     description: Mapping containing keystone's fernet keys and their paths.
129   KeystoneFernetMaxActiveKeys:
130     type: number
131     description: The maximum active keys in the keystone fernet key repository.
132     default: 5
133   ManageKeystoneFernetKeys:
134     type: boolean
135     default: true
136     description: Whether TripleO should manage the keystone fernet keys or not.
137                  If set to true, the fernet keys will get the values from the
138                  saved keys repository in mistral (the KeystoneFernetKeys
139                  variable). If set to false, only the stack creation
140                  initializes the keys, but subsequent updates won't touch them.
141   KeystoneLoggingSource:
142     type: json
143     default:
144       tag: openstack.keystone
145       path: /var/log/keystone/keystone.log
146   EnableInternalTLS:
147     type: boolean
148     default: false
149   KeystoneCronTokenFlushEnsure:
150     type: string
151     description: >
152         Cron to purge expired tokens - Ensure
153     default: 'present'
154   KeystoneCronTokenFlushMinute:
155     type: comma_delimited_list
156     description: >
157         Cron to purge expired tokens - Minute
158     default: '1'
159   KeystoneCronTokenFlushHour:
160     type: comma_delimited_list
161     description: >
162         Cron to purge expired tokens - Hour
163     default: '*'
164   KeystoneCronTokenFlushMonthday:
165     type: comma_delimited_list
166     description: >
167         Cron to purge expired tokens - Month Day
168     default: '*'
169   KeystoneCronTokenFlushMonth:
170     type: comma_delimited_list
171     description: >
172         Cron to purge expired tokens - Month
173     default: '*'
174   KeystoneCronTokenFlushWeekday:
175     type: comma_delimited_list
176     description: >
177         Cron to purge expired tokens - Week Day
178     default: '*'
179   KeystoneCronTokenFlushMaxDelay:
180     type: string
181     description: >
182         Cron to purge expired tokens - Max Delay
183     default: '0'
184   KeystoneCronTokenFlushDestination:
185     type: string
186     description: >
187         Cron to purge expired tokens - Log destination
188     default: '/var/log/keystone/keystone-tokenflush.log'
189   KeystoneCronTokenFlushUser:
190     type: string
191     description: >
192         Cron to purge expired tokens - User
193     default: 'keystone'
194   KeystonePolicies:
195     description: |
196       A hash of policies to configure for Keystone.
197       e.g. { keystone-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
198     default: {}
199     type: json
200   KeystoneLDAPDomainEnable:
201     description: Trigger to call ldap_backend puppet keystone define.
202     type: boolean
203     default: False
204   KeystoneLDAPBackendConfigs:
205     description: Hash containing the configurations for the LDAP backends
206                  configured in keystone.
207     type: json
208     default: {}
209     hidden: true
210   NotificationDriver:
211     type: string
212     default: 'messagingv2'
213     description: Driver or drivers to handle sending notifications.
214     constraints:
215       - allowed_values: [ 'messagingv2', 'noop' ]
216
217 parameter_groups:
218 - label: deprecated
219   description: |
220    The following parameters are deprecated and will be removed. They should not
221    be relied on for new deployments. If you have concerns regarding deprecated
222    parameters, please contact the TripleO development team on IRC or the
223    OpenStack mailing list.
224   parameters:
225   - KeystoneFernetKey0
226   - KeystoneFernetKey1
227   - KeystoneNotificationDriver
228
229 resources:
230
231   ApacheServiceBase:
232     type: ./apache.yaml
233     properties:
234       ServiceData: {get_param: ServiceData}
235       ServiceNetMap: {get_param: ServiceNetMap}
236       DefaultPasswords: {get_param: DefaultPasswords}
237       EndpointMap: {get_param: EndpointMap}
238       RoleName: {get_param: RoleName}
239       RoleParameters: {get_param: RoleParameters}
240       EnableInternalTLS: {get_param: EnableInternalTLS}
241
242 conditions:
243   keystone_fernet_tokens: {equals: [{get_param: KeystoneTokenProvider}, "fernet"]}
244   keystone_ldap_domain_enabled: {equals: [{get_param: KeystoneLDAPDomainEnable}, True]}
245   service_debug_unset: {equals : [{get_param: KeystoneDebug}, '']}
246
247 outputs:
248   role_data:
249     description: Role data for the Keystone role.
250     value:
251       service_name: keystone
252       monitoring_subscription: {get_param: MonitoringSubscriptionKeystone}
253       logging_source: {get_param: KeystoneLoggingSource}
254       logging_groups:
255         - keystone
256       config_settings:
257         map_merge:
258           - get_attr: [ApacheServiceBase, role_data, config_settings]
259           - keystone::database_connection:
260               make_url:
261                 scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
262                 username: keystone
263                 password: {get_param: AdminToken}
264                 host: {get_param: [EndpointMap, MysqlInternal, host]}
265                 path: /keystone
266                 query:
267                   read_default_file: /etc/my.cnf.d/tripleo.cnf
268                   read_default_group: tripleo
269             keystone::admin_token: {get_param: AdminToken}
270             keystone::admin_password: {get_param: AdminPassword}
271             keystone::roles::admin::password: {get_param: AdminPassword}
272             keystone::policy::policies: {get_param: KeystonePolicies}
273             keystone_ssl_certificate: {get_param: KeystoneSSLCertificate}
274             keystone_ssl_certificate_key: {get_param: KeystoneSSLCertificateKey}
275             keystone::token_provider: {get_param: KeystoneTokenProvider}
276             keystone::enable_fernet_setup: {if: [keystone_fernet_tokens, true, false]}
277             keystone::fernet_max_active_keys: {get_param: KeystoneFernetMaxActiveKeys}
278             keystone::enable_proxy_headers_parsing: true
279             keystone::enable_credential_setup: true
280             keystone::credential_keys:
281               '/etc/keystone/credential-keys/0':
282                 content: {get_param: KeystoneCredential0}
283               '/etc/keystone/credential-keys/1':
284                 content: {get_param: KeystoneCredential1}
285             keystone::fernet_keys: {get_param: KeystoneFernetKeys}
286             keystone::fernet_replace_keys: {get_param: ManageKeystoneFernetKeys}
287             keystone::debug:
288               if:
289               - service_debug_unset
290               - {get_param: Debug }
291               - {get_param: KeystoneDebug }
292             keystone::rabbit_userid: {get_param: RabbitUserName}
293             keystone::rabbit_password: {get_param: RabbitPassword}
294             keystone::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
295             keystone::rabbit_port: {get_param: RabbitClientPort}
296             keystone::notification_driver: {get_param: NotificationDriver}
297             keystone::notification_format: {get_param: KeystoneNotificationFormat}
298             keystone::roles::admin::email: {get_param: AdminEmail}
299             keystone::roles::admin::password: {get_param: AdminPassword}
300             keystone::endpoint::public_url: {get_param: [EndpointMap, KeystonePublic, uri_no_suffix]}
301             keystone::endpoint::internal_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
302             keystone::endpoint::admin_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
303             keystone::endpoint::region: {get_param: KeystoneRegion}
304             keystone::endpoint::version: ''
305             keystone_enable_db_purge: {get_param: KeystoneEnableDBPurge}
306             keystone::rabbit_heartbeat_timeout_threshold: 60
307             keystone::cron::token_flush::maxdelay: 3600
308             keystone::roles::admin::service_tenant: 'service'
309             keystone::roles::admin::admin_tenant: 'admin'
310             keystone::cron::token_flush::destination: '/var/log/keystone/keystone-tokenflush.log'
311             keystone::config::keystone_config:
312               ec2/driver:
313                 value: 'keystone.contrib.ec2.backends.sql.Ec2'
314             keystone::service_name: 'httpd'
315             keystone::enable_ssl: {get_param: EnableInternalTLS}
316             keystone::wsgi::apache::ssl: {get_param: EnableInternalTLS}
317             keystone::wsgi::apache::servername:
318               str_replace:
319                 template:
320                   "%{hiera('fqdn_$NETWORK')}"
321                 params:
322                   $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
323             keystone::wsgi::apache::servername_admin:
324               str_replace:
325                 template:
326                   "%{hiera('fqdn_$NETWORK')}"
327                 params:
328                   $NETWORK: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
329             keystone::wsgi::apache::workers: {get_param: KeystoneWorkers}
330             # override via extraconfig:
331             keystone::wsgi::apache::threads: 1
332             keystone::db::database_db_max_retries: -1
333             keystone::db::database_max_retries: -1
334             tripleo.keystone.firewall_rules:
335               '111 keystone':
336                 dport:
337                   - 5000
338                   - 13000
339                   - 35357
340                   - 13357
341             keystone::admin_bind_host:
342               str_replace:
343                 template:
344                   "%{hiera('fqdn_$NETWORK')}"
345                 params:
346                   $NETWORK: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
347             keystone::public_bind_host:
348               str_replace:
349                 template:
350                   "%{hiera('fqdn_$NETWORK')}"
351                 params:
352                   $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
353             # NOTE: bind IP is found in Heat replacing the network name with the
354             # local node IP for the given network; replacement examples
355             # (eg. for internal_api):
356             # internal_api -> IP
357             # internal_api_uri -> [IP]
358             # internal_api_subnet - > IP/CIDR
359             # NOTE: this applies to all 2 bind IP settings below...
360             keystone::wsgi::apache::bind_host: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
361             keystone::wsgi::apache::admin_bind_host: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
362             keystone::cron::token_flush::ensure: {get_param: KeystoneCronTokenFlushEnsure}
363             keystone::cron::token_flush::minute: {get_param: KeystoneCronTokenFlushMinute}
364             keystone::cron::token_flush::hour: {get_param: KeystoneCronTokenFlushHour}
365             keystone::cron::token_flush::monthday: {get_param: KeystoneCronTokenFlushMonthday}
366             keystone::cron::token_flush::month: {get_param: KeystoneCronTokenFlushMonth}
367             keystone::cron::token_flush::weekday: {get_param: KeystoneCronTokenFlushWeekday}
368             keystone::cron::token_flush::maxdelay: {get_param: KeystoneCronTokenFlushMaxDelay}
369             keystone::cron::token_flush::destination: {get_param: KeystoneCronTokenFlushDestination}
370             keystone::cron::token_flush::user: {get_param: KeystoneCronTokenFlushUser}
371           -
372             if:
373             - keystone_ldap_domain_enabled
374             -
375               tripleo::profile::base::keystone::ldap_backend_enable: True
376               keystone::using_domain_config: True
377               tripleo::profile::base::keystone::ldap_backends_config:
378                 get_param: KeystoneLDAPBackendConfigs
379             - {}
380
381       step_config: |
382         include ::tripleo::profile::base::keystone
383       service_config_settings:
384         mysql:
385           keystone::db::mysql::password: {get_param: AdminToken}
386           keystone::db::mysql::user: keystone
387           keystone::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
388           keystone::db::mysql::dbname: keystone
389           keystone::db::mysql::allowed_hosts:
390             - '%'
391             - "%{hiera('mysql_bind_host')}"
392         horizon:
393           if:
394           - keystone_ldap_domain_enabled
395           -
396             horizon::keystone_multidomain_support: true
397             horizon::keystone_default_domain: 'Default'
398           - {}
399       metadata_settings:
400         get_attr: [ApacheServiceBase, role_data, metadata_settings]
401       upgrade_tasks:
402         yaql:
403           expression: $.data.apache_upgrade + $.data.keystone_upgrade
404           data:
405             apache_upgrade:
406               get_attr: [ApacheServiceBase, role_data, upgrade_tasks]
407             keystone_upgrade:
408               - name: Stop keystone service (running under httpd)
409                 tags: step1
410                 service: name=httpd state=stopped