Merge "Add special case handling for OVS upgrade in updates and upgrades"
[apex-tripleo-heat-templates.git] / puppet / services / keystone.yaml
1 heat_template_version: 2016-04-08
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   ServiceNetMap:
36     default: {}
37     description: Mapping of service_name -> network name. Typically set
38                  via parameter_defaults in the resource registry.  This
39                  mapping overrides those in ServiceNetMapDefaults.
40     type: json
41   DefaultPasswords:
42     default: {}
43     type: json
44   EndpointMap:
45     default: {}
46     description: Mapping of service endpoint -> protocol. Typically set
47                  via parameter_defaults in the resource registry.
48     type: json
49   Debug:
50     type: string
51     default: ''
52   AdminEmail:
53     default: 'admin@example.com'
54     description: The email for the keystone admin account.
55     type: string
56     hidden: true
57   AdminPassword:
58     description: The password for the keystone admin account, used for monitoring, querying neutron etc.
59     type: string
60     hidden: true
61   AdminToken:
62     description: The keystone auth secret and db password.
63     type: string
64     hidden: true
65   RabbitPassword:
66     description: The password for RabbitMQ
67     type: string
68     hidden: true
69   RabbitUserName:
70     default: guest
71     description: The username for RabbitMQ
72     type: string
73   RabbitClientUseSSL:
74     default: false
75     description: >
76         Rabbit client subscriber parameter to specify
77         an SSL connection to the RabbitMQ host.
78     type: string
79   RabbitClientPort:
80     default: 5672
81     description: Set rabbit subscriber port, change this if using SSL
82     type: number
83   KeystoneWorkers:
84     type: string
85     description: Set the number of workers for keystone::wsgi::apache
86     default: '"%{::os_workers}"'
87   MonitoringSubscriptionKeystone:
88     default: 'overcloud-kestone'
89     type: string
90   KeystoneCredential0:
91     type: string
92     description: The first Keystone credential key. Must be a valid key.
93   KeystoneCredential1:
94     type: string
95     description: The second Keystone credential key. Must be a valid key.
96   KeystoneLoggingSource:
97     type: json
98     default:
99       tag: openstack.keystone
100       path: /var/log/keystone/keystone.log
101   EnableInternalTLS:
102     type: boolean
103     default: false
104
105 resources:
106
107   ApacheServiceBase:
108     type: ./apache.yaml
109     properties:
110       ServiceNetMap: {get_param: ServiceNetMap}
111       DefaultPasswords: {get_param: DefaultPasswords}
112       EndpointMap: {get_param: EndpointMap}
113       EnableInternalTLS: {get_param: EnableInternalTLS}
114
115 outputs:
116   role_data:
117     description: Role data for the Keystone role.
118     value:
119       service_name: keystone
120       monitoring_subscription: {get_param: MonitoringSubscriptionKeystone}
121       logging_source: {get_param: KeystoneLoggingSource}
122       logging_groups:
123         - keystone
124       config_settings:
125         map_merge:
126           - get_attr: [ApacheServiceBase, role_data, config_settings]
127           - keystone::database_connection:
128               list_join:
129                 - ''
130                 - - {get_param: [EndpointMap, MysqlInternal, protocol]}
131                   - '://keystone:'
132                   - {get_param: AdminToken}
133                   - '@'
134                   - {get_param: [EndpointMap, MysqlInternal, host]}
135                   - '/keystone'
136             keystone::admin_token: {get_param: AdminToken}
137             keystone::roles::admin::password: {get_param: AdminPassword}
138             keystone_ssl_certificate: {get_param: KeystoneSSLCertificate}
139             keystone_ssl_certificate_key: {get_param: KeystoneSSLCertificateKey}
140             keystone::enable_proxy_headers_parsing: true
141             keystone::enable_credential_setup: true
142             keystone::credential_keys:
143               '/etc/keystone/credential-keys/0':
144                 content: {get_param: KeystoneCredential0}
145               '/etc/keystone/credential-keys/1':
146                 content: {get_param: KeystoneCredential1}
147             keystone::debug: {get_param: Debug}
148             keystone::rabbit_userid: {get_param: RabbitUserName}
149             keystone::rabbit_password: {get_param: RabbitPassword}
150             keystone::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
151             keystone::rabbit_port: {get_param: RabbitClientPort}
152             keystone::notification_driver: {get_param: KeystoneNotificationDriver}
153             keystone::notification_format: {get_param: KeystoneNotificationFormat}
154             keystone::roles::admin::email: {get_param: AdminEmail}
155             keystone::roles::admin::password: {get_param: AdminPassword}
156             keystone::endpoint::public_url: {get_param: [EndpointMap, KeystonePublic, uri_no_suffix]}
157             keystone::endpoint::internal_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
158             keystone::endpoint::admin_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
159             keystone::endpoint::region: {get_param: KeystoneRegion}
160             keystone_enable_db_purge: {get_param: KeystoneEnableDBPurge}
161             keystone::rabbit_heartbeat_timeout_threshold: 60
162             keystone::cron::token_flush::maxdelay: 3600
163             keystone::roles::admin::service_tenant: 'service'
164             keystone::roles::admin::admin_tenant: 'admin'
165             keystone::cron::token_flush::destination: '/dev/null'
166             keystone::config::keystone_config:
167               ec2/driver:
168                 value: 'keystone.contrib.ec2.backends.sql.Ec2'
169             keystone::service_name: 'httpd'
170             keystone::enable_ssl: {get_param: EnableInternalTLS}
171             keystone::wsgi::apache::ssl: {get_param: EnableInternalTLS}
172             keystone::wsgi::apache::servername:
173               str_replace:
174                 template:
175                   '"%{::fqdn_$NETWORK}"'
176                 params:
177                   $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
178             keystone::wsgi::apache::servername_admin:
179               str_replace:
180                 template:
181                   '"%{::fqdn_$NETWORK}"'
182                 params:
183                   $NETWORK: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
184             keystone::wsgi::apache::workers: {get_param: KeystoneWorkers}
185             # override via extraconfig:
186             keystone::wsgi::apache::threads: 1
187             keystone::db::database_db_max_retries: -1
188             keystone::db::database_max_retries: -1
189             tripleo.keystone.firewall_rules:
190               '111 keystone':
191                 dport:
192                   - 5000
193                   - 13000
194                   - 35357
195                   - 13357
196             keystone::admin_bind_host:
197               str_replace:
198                 template:
199                   '"%{::fqdn_$NETWORK}"'
200                 params:
201                   $NETWORK: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
202             keystone::public_bind_host:
203               str_replace:
204                 template:
205                   '"%{::fqdn_$NETWORK}"'
206                 params:
207                   $NETWORK: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
208             # NOTE: bind IP is found in Heat replacing the network name with the
209             # local node IP for the given network; replacement examples
210             # (eg. for internal_api):
211             # internal_api -> IP
212             # internal_api_uri -> [IP]
213             # internal_api_subnet - > IP/CIDR
214             # NOTE: this applies to all 2 bind IP settings below...
215             keystone::wsgi::apache::bind_host: {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}
216             keystone::wsgi::apache::admin_bind_host: {get_param: [ServiceNetMap, KeystoneAdminApiNetwork]}
217       step_config: |
218         include ::tripleo::profile::base::keystone
219       service_config_settings:
220         mysql:
221           keystone::db::mysql::password: {get_param: AdminToken}
222           keystone::db::mysql::user: keystone
223           keystone::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
224           keystone::db::mysql::dbname: keystone
225           keystone::db::mysql::allowed_hosts:
226             - '%'
227             - "%{hiera('mysql_bind_host')}"