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