Merge "Shift nova user config to enable_compute task"

This commit is contained in:
Jenkins 2017-02-28 13:54:51 +00:00 committed by Gerrit Code Review
commit 5d15b1eb23
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

@ -505,28 +505,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

@ -488,16 +488,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