Implement ::gnocchi::client

Create ::gnocchi::client class that takes care of python-gnocchiclient
package.

Change-Id: I1118f48fb5cbeaaa920035b1ba14767744c8a083
This commit is contained in:
Emilien Macchi 2015-12-01 14:15:30 -05:00
parent 2a85f4f1e4
commit 1d0ba66a12
5 changed files with 59 additions and 0 deletions

View File

@ -25,3 +25,5 @@ class { '::gnocchi::statsd':
archive_policy_name => 'high',
flush_delay => '100',
}
include ::gnocchi::client

21
manifests/client.pp Normal file
View File

@ -0,0 +1,21 @@
#
# Installs the gnocchi python library.
#
# == parameters
# [*ensure*]
# ensure state for package.
#
class gnocchi::client (
$ensure = 'present'
) {
include ::gnocchi::params
package { 'python-gnocchiclient':
ensure => $ensure,
name => $::gnocchi::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -12,6 +12,7 @@ class gnocchi::params {
$carbonara_package_name = 'openstack-gnocchi-carbonara'
$statsd_package_name = 'openstack-gnocchi-statsd'
$statsd_service_name = 'openstack-gnocchi-statsd'
$client_package_name = 'python-gnocchiclient'
$gnocchi_wsgi_script_path = '/var/www/cgi-bin/gnocchi'
$gnocchi_wsgi_script_source = '/usr/lib/python2.7/site-packages/gnocchi/rest/app.wsgi'
}
@ -24,6 +25,7 @@ class gnocchi::params {
$carbonara_package_name = 'gnocchi-carbonara'
$statsd_package_name = 'gnocchi-statsd'
$statsd_service_name = 'gnocchi-statsd'
$client_package_name = 'python-gnocchiclient'
$gnocchi_wsgi_script_path = '/usr/lib/cgi-bin/gnocchi'
$gnocchi_wsgi_script_source = '/usr/share/gnocchi-common/app.wsgi'
}

View File

@ -47,6 +47,7 @@ describe 'basic gnocchi' do
user_id => 'f81e9b1f-9505-4298-bc33-43dfbd9a973b',
project_id => '203ef419-e73f-4b8a-a73f-3d599a72b18d',
}
class { '::gnocchi::client': }
}
}
EOS

View File

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