Shift nova user config to enable_compute task

Make nova user configuration before ceilometer/compute task since
ceilometer-common package reset shell of nova user to /bin/false back.

Change-Id: I92be4cb23ad4ffe2cbd52562b40e336a1ad1e352
Closes-Bug: #1660981
This commit is contained in:
Michael Polenchuk 2017-02-13 17:02:25 +04:00
parent 1b40f3c3e8
commit 2c381ff80b
5 changed files with 34 additions and 35 deletions

View File

@ -176,7 +176,7 @@
type: puppet
version: 2.1.0
groups: [compute]
requires: [top-role-compute]
requires: [top-role-compute, ceilometer-compute]
required_for: [deploy_end]
refresh_on: [nova_config, nova_paste_api_ini]
cross-depends:

View File

@ -498,28 +498,4 @@ class openstack_tasks::roles::compute {
ensure_packages([$scp_package, $multipath_tools_package])
# Configure ssh key authentication between compute nodes
# (required for non-live/cold migration)
$ssh_key_path = '/var/lib/astute/nova'
install_ssh_keys { 'nova_ssh_key_for_migration':
ensure => present,
user => 'nova',
private_key_path => "${ssh_key_path}/nova",
public_key_path => "${ssh_key_path}/nova.pub",
} ->
file { '/var/lib/nova/.ssh/config':
ensure => present,
owner => 'nova',
group => 'nova',
mode => '0600',
content => "Host *\n StrictHostKeyChecking no\n",
}
user { 'nova':
ensure => present,
shell => '/bin/rbash',
require => Package['nova-common'],
}
}

View File

@ -34,4 +34,27 @@ class openstack_tasks::roles::enable_compute {
hasrestart => true,
}
# Configure ssh key authentication between compute nodes
# (required for non-live/cold migration)
$ssh_key_path = '/var/lib/astute/nova'
install_ssh_keys { 'nova_ssh_key_for_migration':
ensure => present,
user => 'nova',
private_key_path => "${ssh_key_path}/nova",
public_key_path => "${ssh_key_path}/nova.pub",
} ->
file { '/var/lib/nova/.ssh/config':
ensure => present,
owner => 'nova',
group => 'nova',
mode => '0600',
content => "Host *\n StrictHostKeyChecking no\n",
}
user { 'nova':
ensure => present,
shell => '/bin/rbash',
}
}

View File

@ -481,16 +481,7 @@ describe manifest do
)
end
it 'should contain migration basics' do
should contain_class('nova::client')
should contain_install_ssh_keys('nova_ssh_key_for_migration')
should contain_file('/var/lib/nova/.ssh/config')
should contain_user('nova').with(
'ensure' => 'present',
'shell' => '/bin/rbash',
'require' => 'Package[nova-common]'
)
end
it { should contain_class('nova::client') }
it 'should contain cpufrequtils' do
if facts[:operatingsystem] == 'Ubuntu'

View File

@ -40,6 +40,15 @@ describe manifest do
end
end
it 'should contain migration basics' do
is_expected.to contain_install_ssh_keys('nova_ssh_key_for_migration')
is_expected.to contain_file('/var/lib/nova/.ssh/config')
is_expected.to contain_user('nova').with(
:ensure => 'present',
:shell => '/bin/rbash',
)
end
end
test_ubuntu_and_centos manifest