'nova' user conflicts with package-created user

In Debian/Ubuntu, the 'nova' user is now created as a system user, which
makes sense.
The 'nova' user created in the 'nova' class is not created as a system
user and is created before the 'nova-common' package is installed and
prevents the installation of the package.
So, require the package to be installed before puppet checks the user
existence and create the 'nova' user as a system user.

Signed-off-by: François Charlier <francois.charlier@enovance.com>
This commit is contained in:
François Charlier 2012-03-16 17:45:06 +01:00
parent 649f335ae4
commit 3d33743b2e
5 changed files with 45 additions and 3 deletions

View File

@ -46,11 +46,15 @@ class nova(
require => Package["python-greenlet"]
}
group { 'nova':
ensure => present
ensure => present,
system => true,
require => Package['nova-common'],
}
user { 'nova':
ensure => present,
gid => 'nova',
ensure => present,
gid => 'nova',
system => true,
require => Package['nova-common'],
}
file { $logdir:
ensure => directory,

View File

@ -0,0 +1,24 @@
require 'spec_helper'
describe 'nova' do
let :facts do
{ :osfamily => 'Debian' }
end
it do
should contain_group('nova').with(
'ensure' => 'present',
'system' => 'true',
'require' => 'Package[nova-common]'
)
end
it do
should contain_user('nova').with(
'ensure' => 'present',
'gid' => 'nova',
'system' => 'true',
'require' => 'Package[nova-common]'
)
end
end

0
spec/fixtures/manifests/site.pp vendored Normal file
View File

1
spec/fixtures/modules/nova vendored Symbolic link
View File

@ -0,0 +1 @@
../../../

13
spec/spec_helper.rb Normal file
View File

@ -0,0 +1,13 @@
require 'puppet'
require 'rspec'
require 'rspec-puppet'
def param_value(subject, type, title, param)
subject.resource(type, title).send(:parameters)[param.to_sym]
end
RSpec.configure do |c|
c.module_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules/'))
# Using an empty site.pp file to avoid: https://github.com/rodjek/rspec-puppet/issues/15
c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests'))
end