Add glare client install support
Change-Id: I00b9ececdbac3b0769bd32b3205b0bd75345efcf Related-Bug: #1744972
This commit is contained in:
parent
3a978f3d05
commit
a5f546e5b0
23
manifests/client.pp
Normal file
23
manifests/client.pp
Normal 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',
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ class glare::params {
|
||||
include ::openstacklib::defaults
|
||||
|
||||
$group = 'glare'
|
||||
$client_package_name = 'python-glareclient'
|
||||
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
|
35
spec/classes/glare_client_spec.rb
Normal file
35
spec/classes/glare_client_spec.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user