Implement Client class

Install ceilometerclient (aodhclient does not exist yet):

* manifest
* unit tests
* acceptance tests
* example manifest

Change-Id: Ib644bd0896af71b5fd0379236c7650588fd407b2
This commit is contained in:
Emilien Macchi 2015-10-20 13:38:31 -04:00
parent 9510ce46e4
commit 78af0f02c3
5 changed files with 59 additions and 0 deletions

View File

@ -13,3 +13,4 @@ class { '::aodh::auth':
auth_password => 'a_big_secret',
}
class { '::aodh::evaluator': }
class { '::aodh::client': }

22
manifests/client.pp Normal file
View File

@ -0,0 +1,22 @@
#
# Installs the aodh python library.
#
# == parameters
# [*ensure*]
# ensure state for pachage.
#
class aodh::client (
$ensure = 'present'
) {
include ::aodh::params
# there is no aodhclient yet
package { 'python-ceilometerclient':
ensure => $ensure,
name => $::aodh::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -2,6 +2,8 @@
#
class aodh::params {
$client_package_name = 'python-ceilometerclient'
case $::osfamily {
'RedHat': {
$common_package_name = 'openstack-aodh-common'

View File

@ -123,6 +123,7 @@ describe 'basic aodh' do
auth_url => 'http://127.0.0.1:5000/v2.0',
auth_password => 'a_big_secret',
}
class { '::aodh::client': }
case $::osfamily {
'Debian': {
warning('aodh-evaluator cannot be run on ubuntu system, package is broken. See LP#1508463')

View File

@ -0,0 +1,33 @@
require 'spec_helper'
describe 'aodh::client' do
shared_examples_for 'aodh client' do
it { is_expected.to contain_class('aodh::params') }
it 'installs aodh client package' do
is_expected.to contain_package('python-ceilometerclient').with(
:ensure => 'present',
:name => 'python-ceilometerclient',
:tag => 'openstack',
)
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'aodh client'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'aodh client'
end
end