Stop manipulating sysconfig/default file
These files are no longer used since libvirt socket were added. The current resources are added to clear the old implementation to modify arguments and have been kept for a while. Now we can safely assume the old configurations have been cleared. Change-Id: I38991bf7852ce6ed07fb6daca98c99f4860fe508
This commit is contained in:
parent
a1c5e3ebf4
commit
2ca2343ea2
|
@ -403,31 +403,5 @@ class nova::migration::libvirt(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
case $facts['os']['family'] {
|
||||
'RedHat': {
|
||||
# NOTE(tkajinam): Since libvirt 8.1.0, the sysconfig files are
|
||||
# no longer provided by packages.
|
||||
# TODO(tkajinam): Remove this after A release.
|
||||
file { '/etc/sysconfig/libvirtd':
|
||||
ensure => absent,
|
||||
path => '/etc/sysconfig/libvirtd',
|
||||
tag => 'libvirt-file',
|
||||
}
|
||||
}
|
||||
'Debian': {
|
||||
# TODO(tkajinam): Remove this after A release.
|
||||
file_line { '/etc/default/libvirtd libvirtd opts':
|
||||
ensure => absent,
|
||||
path => '/etc/default/libvirtd',
|
||||
match => '^libvirtd_opts=$',
|
||||
match_for_absence => true,
|
||||
tag => 'libvirt-file_line',
|
||||
}
|
||||
}
|
||||
default: {
|
||||
warning("Unsupported osfamily: ${facts['os']['family']}, make sure you are configuring this yourself")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -381,99 +381,11 @@ describe 'nova::migration::libvirt' do
|
|||
it { is_expected.to contain_nova_config('libvirt/live_migration_uri').with_value('qemu+ssh://%s/system?foo=%%25&bar=baz')}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
shared_examples_for 'nova migration with libvirt in Debian' do
|
||||
context 'with tls transport' do
|
||||
let :params do
|
||||
{ :transport => 'tls' }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
||||
:ensure => 'absent',
|
||||
:path => '/etc/default/libvirtd',
|
||||
:match => '^libvirtd_opts=$',
|
||||
:match_for_absence => true,
|
||||
) }
|
||||
it { is_expected.to contain_service('libvirtd-tls').with(
|
||||
:name => 'libvirtd-tls.socket',
|
||||
:ensure => 'running',
|
||||
:enable => true,
|
||||
)}
|
||||
it { is_expected.to contain_file('/etc/systemd/system/libvirtd-tls.socket').with(
|
||||
:ensure => 'absent',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with tcp transport' do
|
||||
let :params do
|
||||
{ :transport => 'tcp' }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
||||
:ensure => 'absent',
|
||||
:path => '/etc/default/libvirtd',
|
||||
:match => '^libvirtd_opts=$',
|
||||
:match_for_absence => true,
|
||||
) }
|
||||
it { is_expected.to contain_service('libvirtd-tcp').with(
|
||||
:name => 'libvirtd-tcp.socket',
|
||||
:ensure => 'running',
|
||||
:enable => true,
|
||||
)}
|
||||
it { is_expected.to contain_file('/etc/systemd/system/libvirtd-tcp.socket').with(
|
||||
:ensure => 'absent',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with tls transport and modular daemons' do
|
||||
let :params do
|
||||
{
|
||||
:transport => 'tls',
|
||||
:modular_libvirt => true,
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_service('virtproxyd-tls').with(
|
||||
:name => 'virtproxyd-tls.socket',
|
||||
:ensure => 'running',
|
||||
:enable => true,
|
||||
)}
|
||||
it { is_expected.to contain_file('/etc/systemd/system/virtproxyd-tls.socket').with(
|
||||
:ensure => 'absent',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with tcp transport and modular daemons' do
|
||||
let :params do
|
||||
{
|
||||
:transport => 'tcp',
|
||||
:modular_libvirt => true,
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_service('virtproxyd-tcp').with(
|
||||
:name => 'virtproxyd-tcp.socket',
|
||||
:ensure => 'running',
|
||||
:enable => true,
|
||||
)}
|
||||
it { is_expected.to contain_file('/etc/systemd/system/virtproxyd-tcp.socket').with(
|
||||
:ensure => 'absent',
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'nova migration with libvirt in RedHat' do
|
||||
context 'with tls transport' do
|
||||
let :params do
|
||||
{ :transport => 'tls' }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
||||
:ensure => 'absent',
|
||||
:path => '/etc/sysconfig/libvirtd',
|
||||
:tag => 'libvirt-file',
|
||||
)}
|
||||
it { is_expected.to contain_service('libvirtd-tls').with(
|
||||
:name => 'libvirtd-tls.socket',
|
||||
:ensure => 'running',
|
||||
|
@ -492,11 +404,6 @@ describe 'nova::migration::libvirt' do
|
|||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
||||
:ensure => 'absent',
|
||||
:path => '/etc/sysconfig/libvirtd',
|
||||
:tag => 'libvirt-file',
|
||||
)}
|
||||
it { is_expected.to contain_service('libvirtd-tcp').with(
|
||||
:name => 'libvirtd-tcp.socket',
|
||||
:ensure => 'running',
|
||||
|
@ -558,12 +465,6 @@ describe 'nova::migration::libvirt' do
|
|||
end
|
||||
|
||||
it_behaves_like 'nova migration with libvirt'
|
||||
case facts[:os]['family']
|
||||
when 'Debian'
|
||||
it_behaves_like 'nova migration with libvirt in Debian'
|
||||
when 'RedHat'
|
||||
it_behaves_like 'nova migration with libvirt in RedHat'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue