Add an openstack::client class for client nodes
Add a class that can be used to create nodes that contain only the openstack client libraries. Also add ceilometer to fixtures so tests pass. Change-Id: I0b9175a582b42fac5cb9f9a10bd5bc877de8632d
This commit is contained in:
		| @@ -7,6 +7,7 @@ fixtures: | ||||
|     'horizon': 'git://github.com/stackforge/puppet-horizon' | ||||
|     'swift' : 'git://github.com/stackforge/puppet-swift' | ||||
|     'quantum': 'git://github.com/stackforge/puppet-quantum' | ||||
|     'ceilometer' : 'git://github.com/stackforge/puppet-ceilometer' | ||||
|     "apt": "git://github.com/puppetlabs/puppetlabs-apt.git" | ||||
|     "apache": "git://github.com/puppetlabs/puppetlabs-apache.git" | ||||
|     "concat": "git://github.com/ripienaar/puppet-concat.git" | ||||
|   | ||||
							
								
								
									
										57
									
								
								manifests/client.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								manifests/client.pp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | ||||
| # | ||||
| # Installs only the OpenStack client libraries | ||||
| # | ||||
| # === Parameters | ||||
| # | ||||
| # [ceilometer] | ||||
| #   (optional) Install the Ceilometer client package | ||||
| # | ||||
| # [cinder] | ||||
| #   (optional) Install the Cinder client package | ||||
| # | ||||
| # [glance] | ||||
| #   (optional) Install the Glance client package | ||||
| # | ||||
| # [keystone] | ||||
| #   (optional) Install the Keystone client package | ||||
| # | ||||
| # [nova] | ||||
| #   (optional) Install the Nova client package | ||||
| # | ||||
| # [quantum] | ||||
| #   (optional) Install the Quantum client package | ||||
| # | ||||
|  | ||||
| class openstack::client ( | ||||
|   $ceilometer = true, | ||||
|   $cinder = true, | ||||
|   $glance = true, | ||||
|   $keystone = true, | ||||
|   $nova = true, | ||||
|   $quantum = true | ||||
| ) { | ||||
|  | ||||
|   if $ceilometer { | ||||
|     include 'ceilometer::client' | ||||
|   } | ||||
|  | ||||
|   if $cinder { | ||||
|     include 'cinder::client' | ||||
|   } | ||||
|  | ||||
|   if $glance { | ||||
|     include 'glance::client' | ||||
|   } | ||||
|  | ||||
|   if $keystone { | ||||
|     include 'keystone::client' | ||||
|   } | ||||
|  | ||||
|   if $nova { | ||||
|     include 'nova::client' | ||||
|   } | ||||
|  | ||||
|   if $quantum { | ||||
|     include 'quantum::client' | ||||
|   } | ||||
| } | ||||
							
								
								
									
										47
									
								
								spec/classes/openstack_client_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								spec/classes/openstack_client_spec.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| require 'spec_helper' | ||||
|  | ||||
| describe 'openstack::client' do | ||||
|  | ||||
|   let :facts do | ||||
|     { :osfamily => 'Debian', :operatingsystem => 'Ubuntu' } | ||||
|   end | ||||
|  | ||||
|   describe 'with default params' do | ||||
|     it { should include_class('ceilometer::client') } | ||||
|     it { should include_class('cinder::client') } | ||||
|     it { should include_class('glance::client') } | ||||
|     it { should include_class('keystone::client') } | ||||
|     it { should include_class('nova::client') } | ||||
|     it { should include_class('quantum::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without ceilometer' do | ||||
|     let (:params) { {:ceilometer => false }} | ||||
|     it { should_not include_class('ceilometer::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without cinder' do | ||||
|     let (:params) { {:cinder => false }} | ||||
|     it { should_not include_class('cinder::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without glance' do | ||||
|     let (:params) { {:glance => false }} | ||||
|     it { should_not include_class('glance::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without keystone' do | ||||
|     let (:params) { {:keystone => false }} | ||||
|     it { should_not include_class('keystone::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without nova' do | ||||
|     let (:params) { {:nova => false }} | ||||
|     it { should_not include_class('nova::client') } | ||||
|   end | ||||
|  | ||||
|   describe 'without quantum' do | ||||
|     let (:params) { {:quantum => false }} | ||||
|     it { should_not include_class('quantum::client') } | ||||
|   end | ||||
| end | ||||
		Reference in New Issue
	
	Block a user
	 Michael Chapman
					Michael Chapman