|
| 1 | +class kickstack::api::keystone inherits kickstack { |
| 2 | + # Grab the Keystone admin token from a kickstack fact and configure |
| 3 | + # Keystone accordingly. If no fact has been set, generate a password. |
| 4 | + $admin_token = pick(getvar("${fact_prefix}keystone_admin_token"),pwgen()) |
| 5 | + |
| 6 | + class { '::keystone': |
| 7 | + package_ensure => 'latest', |
| 8 | + verbose => 'True', |
| 9 | + catalog_type => 'sql', |
| 10 | + admin_token => $admin_token, |
| 11 | + sql_connection => getvar("${fact_prefix}keystone_sql_connection"), |
| 12 | + } |
| 13 | + |
| 14 | + kickstack::exportfact::export { "keystone_admin_token": |
| 15 | + value => "${admin_token}", |
| 16 | + tag => "keystone", |
| 17 | + require => Class['::keystone'] |
| 18 | + } |
| 19 | + |
| 20 | + # Installs the service user endpoint. |
| 21 | + class { '::keystone::endpoint': |
| 22 | + public_address => "${hostname}${keystone_public_suffix}", |
| 23 | + admin_address => "${hostname}${keystone_admin_suffix}", |
| 24 | + internal_address => $hostname, |
| 25 | + region => $keystone_region, |
| 26 | + require => Class['::keystone'] |
| 27 | + } |
| 28 | + |
| 29 | + kickstack::exportfact::export { "keystone_internal_address": |
| 30 | + value => "${hostname}", |
| 31 | + tag => "keystone", |
| 32 | + require => Class['::keystone::endpoint'] |
| 33 | + } |
| 34 | + |
| 35 | + # Adds the admin credential to keystone. |
| 36 | + class { '::keystone::roles::admin': |
| 37 | + email => $keystone_admin_email, |
| 38 | + password => $keystone_admin_password, |
| 39 | + admin_tenant => $keystone_admin_tenant, |
| 40 | + service_tenant => $keystone_service_tenant, |
| 41 | + require => Class['::keystone::endpoint'] |
| 42 | + } |
| 43 | +} |
0 commit comments