Add glare client install support

Change-Id: I00b9ececdbac3b0769bd32b3205b0bd75345efcf
Related-Bug: #1744972
This commit is contained in:
Brad P. Crochet 2018-01-23 11:58:35 -05:00
parent 3a978f3d05
commit a5f546e5b0
3 changed files with 59 additions and 0 deletions

23
manifests/client.pp Normal file
View File

@ -0,0 +1,23 @@
# == Class: glare::client
#
# Installs the glare python library.
#
# === Parameters:
#
# [*ensure*]
# (Optional) Ensure state for pachage.
# Defaults to 'present'.
#
class glare::client (
$ensure = 'present'
) {
include ::glare::deps
include ::glare::params
package { 'python-glareclient':
ensure => $ensure,
name => $::glare::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -4,6 +4,7 @@ class glare::params {
include ::openstacklib::defaults
$group = 'glare'
$client_package_name = 'python-glareclient'
case $::osfamily {
'RedHat': {

View File

@ -0,0 +1,35 @@
require 'spec_helper'
describe 'glare::client' do
shared_examples_for 'glare client' do
it { is_expected.to contain_class('glare::deps') }
it { is_expected.to contain_class('glare::params') }
it 'installs glare client package' do
is_expected.to contain_package('python-glareclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :client_package_name => 'python-glareclient' }
end
it_behaves_like 'glare client'
end
end
end