Puppet Class: kickstack::keystone::api

Inherits:
kickstack
Defined in:
manifests/keystone/api.pp

Overview



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'manifests/keystone/api.pp', line 1

class kickstack::keystone::api inherits kickstack {
  include pwgen  

  $admin_token = pick(getvar("${fact_prefix}keystone_admin_token"),pwgen())
  $admin_password = pick(getvar("${fact_prefix}keystone_admin_password"),pwgen())
  $admin_tenant = $::kickstack::keystone_admin_tenant
  $sql_conn = getvar("${fact_prefix}keystone_sql_connection")

  class { '::keystone':
    package_ensure => $::kickstack::package_version,
    verbose        => $kickstack::verbose,
    debug          => $kickstack::debug,
    catalog_type   => 'sql',
    admin_token    => $admin_token,
    sql_connection => $sql_conn,
  }

  # Installs the service user endpoint.
  class { '::keystone::endpoint':
    public_address   => "${hostname}${keystone_public_suffix}",
    admin_address    => "${hostname}${keystone_admin_suffix}",
    internal_address => $hostname,
    region           => $keystone_region,
    require      => Class['::keystone']
  }

  kickstack::exportfact::export { "keystone_admin_token":
    value => "${admin_token}",
    tag => "keystone",
    require => Class['::keystone']
  }

  kickstack::exportfact::export { "keystone_internal_address":
    value => "${hostname}",
    tag => "keystone",
    require => Class['::keystone::endpoint']
  }

  # Adds the admin credential to keystone.
  class { '::keystone::roles::admin':
    email        => $kickstack::keystone_admin_email,
    password     => $admin_password,
    admin_tenant => $admin_tenant,
    service_tenant => $kickstack::keystone_service_tenant,
    require      => Class['::keystone::endpoint']
  }

  file { '/root/openstackrc':
    owner => root,
    group => root,
    mode => '0640',
    content => template('kickstack/openstackrc.erb'),
    require => Class['::keystone::roles::admin']
  }

  kickstack::exportfact::export { "keystone_admin_password":
    value => $admin_password,
    tag => "keystone",
    require => Class['::keystone::roles::admin']
  }

}