'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:
parent
649f335ae4
commit
3d33743b2e
@ -46,11 +46,15 @@ class nova(
|
|||||||
require => Package["python-greenlet"]
|
require => Package["python-greenlet"]
|
||||||
}
|
}
|
||||||
group { 'nova':
|
group { 'nova':
|
||||||
ensure => present
|
ensure => present,
|
||||||
|
system => true,
|
||||||
|
require => Package['nova-common'],
|
||||||
}
|
}
|
||||||
user { 'nova':
|
user { 'nova':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
gid => 'nova',
|
gid => 'nova',
|
||||||
|
system => true,
|
||||||
|
require => Package['nova-common'],
|
||||||
}
|
}
|
||||||
file { $logdir:
|
file { $logdir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
|
24
spec/classes/nova_init_spec.rb
Normal file
24
spec/classes/nova_init_spec.rb
Normal 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
0
spec/fixtures/manifests/site.pp
vendored
Normal file
1
spec/fixtures/modules/nova
vendored
Symbolic link
1
spec/fixtures/modules/nova
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../
|
13
spec/spec_helper.rb
Normal file
13
spec/spec_helper.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user