Add hypervisor_inspector in ceilometer.conf

Add hypervisor_inspector configuration in ceilometer.conf, it's necessary
in some cases, for example, if we want to use this cookbook's template to
support installation of ceilometer agent on windows platform.

Change-Id: Ie42eb3d055ff1dbc3944adb18777073044983ed4
Closes-Bug: #1300080
This commit is contained in:
Quan Guo 2014-03-14 14:25:24 +08:00
parent f0cec188f9
commit 8aded3d41a
7 changed files with 24 additions and 0 deletions

View File

@ -4,3 +4,9 @@ cookbook "openstack-common",
git: "git://github.com/stackforge/cookbook-openstack-common.git"
cookbook "openstack-identity",
git: "git://github.com/stackforge/cookbook-openstack-identity.git"
cookbook "openstack-compute",
git: "git://github.com/stackforge/cookbook-openstack-compute.git"
cookbook "openstack-image",
git: "git://github.com/stackforge/cookbook-openstack-image.git"
cookbook "openstack-network",
git: "git://github.com/stackforge/cookbook-openstack-network.git"

View File

@ -7,3 +7,4 @@ gem 'chefspec', '~> 3.4.0'
gem 'foodcritic', '~> 3.0.3'
gem 'strainer'
gem 'rubocop', '~> 0.18.1'
gem 'fauxhai', '>= 2.1.0'

View File

@ -231,6 +231,7 @@ DEPENDENCIES
berkshelf (~> 2.0.10)
chef (~> 11.8)
chefspec (~> 3.4.0)
fauxhai (>= 2.1.0)
foodcritic (~> 3.0.3)
json (<= 1.7.7)
rubocop (~> 0.18.1)

View File

@ -42,6 +42,13 @@ default['openstack']['telemetry']['service_user'] = 'ceilometer'
default['openstack']['telemetry']['service_tenant_name'] = 'service'
default['openstack']['telemetry']['service_role'] = 'admin'
case node['openstack']['compute']['driver']
when 'libvirt.LibvirtDriver'
default['openstack']['telemetry']['hypervisor_inspector'] = 'libvirt'
else
default['openstack']['telemetry']['hypervisor_inspector'] = nil
end
case platform
when 'suse' # :pragma-foodcritic: ~FC024 - won't fix this
default['openstack']['telemetry']['platform'] = {

View File

@ -20,3 +20,4 @@ end
depends 'openstack-common', '~> 9.0'
depends 'openstack-identity', '~> 9.0'
depends 'openstack-compute', '~> 9.0'

View File

@ -150,6 +150,11 @@ describe 'openstack-telemetry::common' do
r = /^metering_secret = metering_secret$/
expect(chef_run).to render_file(file.name).with_content(r)
end
it 'has hypervisor inspector' do
r = /^hypervisor_inspector = libvirt$/
expect(chef_run).to render_file(file.name).with_content(r)
end
end
describe 'policy.json' do

View File

@ -10,6 +10,9 @@ policy_file = /etc/ceilometer/policy.json
database_connection = <%= @database_connection %>
verbose = <%= node["openstack"]["telemetry"]["verbose"] %>
debug = <%= node["openstack"]["telemetry"]["debug"] %>
<% if node["openstack"]["telemetry"]["hypervisor_inspector"] %>
hypervisor_inspector = <%= node["openstack"]["telemetry"]["hypervisor_inspector"] %>
<% end %>
<% if node["openstack"]["telemetry"]["syslog"]["use"] %>
log_config = /etc/openstack/logging.conf
<% end %>