Merge pull request #647 from enovance/nova-user
hypervisor: manage nova shell
This commit is contained in:
commit
aa3d9a8293
@ -49,6 +49,13 @@
|
|||||||
# You may have side effects (SElinux for example).
|
# You may have side effects (SElinux for example).
|
||||||
# Defaults to '/var/lib/nova/instances'
|
# Defaults to '/var/lib/nova/instances'
|
||||||
#
|
#
|
||||||
|
# [*nova_shell*]
|
||||||
|
# (optional) Full path of shell to run for nova user.
|
||||||
|
# To disable live migration & resize, set it to '/bin/nologin' or false.
|
||||||
|
# Otherwise, set the value to '/bin/bash'.
|
||||||
|
# Need to be a valid shell path.
|
||||||
|
# Defaults to false
|
||||||
|
#
|
||||||
class cloud::compute::hypervisor(
|
class cloud::compute::hypervisor(
|
||||||
$server_proxyclient_address = '127.0.0.1',
|
$server_proxyclient_address = '127.0.0.1',
|
||||||
$libvirt_type = 'kvm',
|
$libvirt_type = 'kvm',
|
||||||
@ -63,6 +70,7 @@ class cloud::compute::hypervisor(
|
|||||||
$vm_rbd = false,
|
$vm_rbd = false,
|
||||||
$volume_rbd = false,
|
$volume_rbd = false,
|
||||||
$manage_tso = true,
|
$manage_tso = true,
|
||||||
|
$nova_shell = false,
|
||||||
# when using NFS storage backend
|
# when using NFS storage backend
|
||||||
$nfs_enabled = false,
|
$nfs_enabled = false,
|
||||||
$nfs_device = false,
|
$nfs_device = false,
|
||||||
@ -165,6 +173,16 @@ Host *
|
|||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $nova_shell {
|
||||||
|
ensure_resource ('user', 'nova', {
|
||||||
|
'ensure' => 'present',
|
||||||
|
'system' => true,
|
||||||
|
'home' => '/var/lib/nova',
|
||||||
|
'managehome' => false,
|
||||||
|
'shell' => $nova_shell,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
class { 'nova::compute':
|
class { 'nova::compute':
|
||||||
enabled => true,
|
enabled => true,
|
||||||
vnc_enabled => false,
|
vnc_enabled => false,
|
||||||
|
@ -81,6 +81,7 @@ describe 'cloud::compute::hypervisor' do
|
|||||||
:ks_spice_public_host => '10.0.0.2',
|
:ks_spice_public_host => '10.0.0.2',
|
||||||
:vm_rbd => false,
|
:vm_rbd => false,
|
||||||
:volume_rbd => false,
|
:volume_rbd => false,
|
||||||
|
:nova_shell => false,
|
||||||
:ks_nova_public_host => '10.0.0.1' }
|
:ks_nova_public_host => '10.0.0.1' }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -224,6 +225,10 @@ describe 'cloud::compute::hypervisor' do
|
|||||||
is_expected.to contain_class('ceilometer::agent::compute')
|
is_expected.to contain_class('ceilometer::agent::compute')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'do not configure nova shell' do
|
||||||
|
is_expected.not_to contain_user('nova')
|
||||||
|
end
|
||||||
|
|
||||||
it 'should not configure nova-compute for RBD backend' do
|
it 'should not configure nova-compute for RBD backend' do
|
||||||
is_expected.not_to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
|
is_expected.not_to contain_nova_config('libvirt/rbd_user').with('value' => 'cinder')
|
||||||
is_expected.not_to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
|
is_expected.not_to contain_nova_config('libvirt/images_type').with('value' => 'rbd')
|
||||||
@ -320,6 +325,21 @@ describe 'cloud::compute::hypervisor' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when managing nova shell' do
|
||||||
|
before :each do
|
||||||
|
params.merge!( :nova_shell => '/bin/bash')
|
||||||
|
end
|
||||||
|
it 'ensure nova shell is configured by Puppet' do
|
||||||
|
is_expected.to contain_user('nova').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:system => true,
|
||||||
|
:home => '/var/lib/nova',
|
||||||
|
:managehome => false,
|
||||||
|
:shell => '/bin/bash'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with RBD backend for instances and volumes on Debian plaforms' do
|
context 'with RBD backend for instances and volumes on Debian plaforms' do
|
||||||
before :each do
|
before :each do
|
||||||
facts.merge!( :osfamily => 'Debian',
|
facts.merge!( :osfamily => 'Debian',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user