Introduce cloudkitty::client
This patch aims to add a new class to manage cloudkitty client. Change-Id: I22acb19a956896dada720c64bd42fd65d621a3b8
This commit is contained in:
		
							
								
								
									
										24
									
								
								manifests/client.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								manifests/client.pp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					# == Class cloudkitty::client
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Installs the cloudkitty client.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# == Parameters
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  [*ensure*]
 | 
				
			||||||
 | 
					#    (Optional) The state for the cloudkitty client package.
 | 
				
			||||||
 | 
					#    Defaults to 'present'.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					class cloudkitty::client (
 | 
				
			||||||
 | 
					  $ensure = 'present'
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  include ::cloudkitty::deps
 | 
				
			||||||
 | 
					  include ::cloudkitty::params
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  package { 'python-cloudkittyclient':
 | 
				
			||||||
 | 
					    ensure => $ensure,
 | 
				
			||||||
 | 
					    name   => $::cloudkitty::params::client_package_name,
 | 
				
			||||||
 | 
					    tag    => 'openstack',
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										31
									
								
								spec/classes/cloudkitty_client_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								spec/classes/cloudkitty_client_spec.rb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					require 'spec_helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					describe 'cloudkitty::client' do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  shared_examples_for 'cloudkitty client' do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    it { is_expected.to contain_class('cloudkitty::deps') }
 | 
				
			||||||
 | 
					    it { is_expected.to contain_class('cloudkitty::params') }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    it 'installs cloudkitty client package' do
 | 
				
			||||||
 | 
					      is_expected.to contain_package('python-cloudkittyclient').with(
 | 
				
			||||||
 | 
					        :ensure => 'present',
 | 
				
			||||||
 | 
					        :name   => 'python-cloudkittyclient',
 | 
				
			||||||
 | 
					        :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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      it_configures 'cloudkitty client'
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
		Reference in New Issue
	
	Block a user