Puppet Class: kickstack::ceilometer::config

Inherits:
kickstack
Defined in:
manifests/ceilometer/config.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
# File 'manifests/ceilometer/config.pp', line 1

class kickstack::ceilometer::config inherits kickstack {

  include pwgen

  $admin_password = getvar("${fact_prefix}ceilometer_keystone_password")
  $sql_conn = getvar("${fact_prefix}ceilometer_sql_connection")

  $existing_secret = getvar("${fact_prefix}ceilometer_metering_secret")

  if $existing_secret {
    $metering_secret = $existing_secret
  } else {
    $metering_secret = pwgen()
    kickstack::exportfact::export { 'ceilometer_metering_secret':
      value => $metering_secret,
      tag => 'ceilometer',
    }
  }

  case "$::kickstack::rpc" {
    'rabbitmq': {
      $rabbit_host = getvar("${::kickstack::fact_prefix}rabbit_host")
      $rabbit_password = getvar("${fact_prefix}rabbit_password")
      class { '::ceilometer':
        package_ensure  => $::kickstack::package_version,
        metering_secret => $metering_secret,
        rpc_backend     => 'ceilometer.openstack.common.rpc.impl_kombu',
        rabbit_host     => $rabbit_host,
        rabbit_password => $rabbit_password,
        rabbit_virtual_host => $::kickstack::rabbit_virtual_host,
        rabbit_userid   => $::kickstack::rabbit_userid,
        verbose         => $::kickstack::verbose,
        debug           => $::kickstack::debug,
      }
    }
    'qpid': {
      $qpid_hostname = getvar("${::kickstack::fact_prefix}qpid_hostname")
      $qpid_password = getvar("${fact_prefix}qpid_password")
      class { '::ceilometer':
        package_ensure  => $::kickstack::package_version,
        metering_secret => $metering_secret,
        rpc_backend     => 'ceilometer.openstack.common.rpc.impl_qpid',
        qpid_hostname   => $qpid_hostname,
        qpid_password   => $qpid_password,
        qpid_realm      => $::kickstack::qpid_realm,
        qpid_user       => $::kickstack::qpid_user,
        verbose         => $::kickstack::verbose,
        debug           => $::kickstack::debug,
      }
    }
  } 
}