Skip to content

Commit

Permalink
Only add ceilometer user to nova group if using compute agent
Browse files Browse the repository at this point in the history
When using ceilometer outside of the compute context (ex: with the
swift middleware), puppet-ceilometer attempts to add the user to
the nova group which does not (and probably should not) exist on
the swift nodes.

Change-Id: I6cc68152325a967c024ce611f92a90ce0afba8cc
(cherry picked from commit d064997)
  • Loading branch information
David Moreau Simard authored and fcharlier committed Jan 14, 2014
1 parent 2f4ac2e commit 7901dff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion manifests/agent/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@

if $::ceilometer::params::libvirt_group {
User['ceilometer'] {
groups +> [$::ceilometer::params::libvirt_group]
groups => ['nova', $::ceilometer::params::libvirt_group]
}
} else {
User['ceilometer'] {
groups => ['nova']
}
}

Expand Down
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
user { 'ceilometer':
name => 'ceilometer',
gid => 'ceilometer',
groups => ['nova'],
system => true,
require => Package['ceilometer-common'],
}
Expand Down
6 changes: 4 additions & 2 deletions spec/classes/ceilometer_agent_compute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
)
end

it 'adds ceilometer user to libvirt group if required' do
it 'adds ceilometer user to nova group and, if required, to libvirt group' do
if platform_params[:libvirt_group]
should contain_user('ceilometer').with_groups(/#{platform_params[:libvirt_group]}/)
should contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"])
else
should contain_user('ceilometer').with_groups('nova')
end
end

Expand Down
1 change: 0 additions & 1 deletion spec/classes/ceilometer_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
should contain_user('ceilometer').with(
:name => 'ceilometer',
:gid => 'ceilometer',
:groups => ['nova'],
:system => true,
:require => 'Package[ceilometer-common]'
)
Expand Down

0 comments on commit 7901dff

Please sign in to comment.