Merge "Drop support for old libvirt package"
This commit is contained in:
@@ -62,6 +62,10 @@ class nova::compute::libvirt::qemu(
|
|||||||
include nova::deps
|
include nova::deps
|
||||||
require nova::compute::libvirt
|
require nova::compute::libvirt
|
||||||
|
|
||||||
|
if versioncmp($libvirt_version, '4.5') < 0 {
|
||||||
|
fail('libvirt verson < 4.5 is no longer supported')
|
||||||
|
}
|
||||||
|
|
||||||
Anchor['nova::config::begin']
|
Anchor['nova::config::begin']
|
||||||
-> Augeas<| tag == 'qemu-conf-augeas'|>
|
-> Augeas<| tag == 'qemu-conf-augeas'|>
|
||||||
-> Anchor['nova::config::end']
|
-> Anchor['nova::config::end']
|
||||||
@@ -107,11 +111,7 @@ class nova::compute::libvirt::qemu(
|
|||||||
} else {
|
} else {
|
||||||
$augues_memory_backing_dir_changes = []
|
$augues_memory_backing_dir_changes = []
|
||||||
}
|
}
|
||||||
if versioncmp($libvirt_version, '4.5') >= 0 {
|
$augues_nbd_tls_changes = ["set nbd_tls ${nbd_tls_value}"]
|
||||||
$augues_nbd_tls_changes = ["set nbd_tls ${nbd_tls_value}"]
|
|
||||||
} else {
|
|
||||||
$augues_nbd_tls_changes = []
|
|
||||||
}
|
|
||||||
|
|
||||||
$augues_changes = concat($augues_changes_default, $augues_group_changes, $augues_memory_backing_dir_changes, $augues_nbd_tls_changes)
|
$augues_changes = concat($augues_changes_default, $augues_group_changes, $augues_memory_backing_dir_changes, $augues_nbd_tls_changes)
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class nova::compute::libvirt::qemu(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$augues_changes_default = [
|
$augues_changes = [
|
||||||
'rm max_files',
|
'rm max_files',
|
||||||
'rm max_processes',
|
'rm max_processes',
|
||||||
'rm group',
|
'rm group',
|
||||||
@@ -130,14 +130,8 @@ class nova::compute::libvirt::qemu(
|
|||||||
'rm vnc_tls_x509_verify',
|
'rm vnc_tls_x509_verify',
|
||||||
'rm default_tls_x509_verify',
|
'rm default_tls_x509_verify',
|
||||||
'rm memory_backing_dir',
|
'rm memory_backing_dir',
|
||||||
|
'rm nbd_tls',
|
||||||
]
|
]
|
||||||
if versioncmp($libvirt_version, '4.5') >= 0 {
|
|
||||||
$augues_nbd_tls_changes = ['rm nbd_tls']
|
|
||||||
} else {
|
|
||||||
$augues_nbd_tls_changes = []
|
|
||||||
}
|
|
||||||
|
|
||||||
$augues_changes = concat($augues_changes_default, $augues_nbd_tls_changes)
|
|
||||||
|
|
||||||
augeas { 'qemu-conf-limits':
|
augeas { 'qemu-conf-limits':
|
||||||
context => '/files/etc/libvirt/qemu.conf',
|
context => '/files/etc/libvirt/qemu.conf',
|
||||||
|
@@ -8,20 +8,14 @@
|
|||||||
class nova::compute::libvirt::version {
|
class nova::compute::libvirt::version {
|
||||||
case $facts['os']['family'] {
|
case $facts['os']['family'] {
|
||||||
'RedHat': {
|
'RedHat': {
|
||||||
if versioncmp($facts['os']['release']['full'], '8') >= 0 {
|
if versioncmp($facts['os']['release']['full'], '9') >= 0 {
|
||||||
$default = '5.6'
|
$default = '7.0'
|
||||||
} elsif versioncmp($facts['os']['release']['full'], '7.6') >= 0 {
|
|
||||||
$default = '4.5'
|
|
||||||
} else {
|
} else {
|
||||||
$default = '3.9'
|
$default = '5.6'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'Debian': {
|
'Debian': {
|
||||||
if versioncmp($facts['os']['release']['full'], '18.04') >= 0 {
|
$default = '6.0'
|
||||||
$default = '6.0'
|
|
||||||
} else {
|
|
||||||
$default = '4.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Class['nova::compute::libvirt::version']: Unsupported osfamily: ${::osfamily}")
|
fail("Class['nova::compute::libvirt::version']: Unsupported osfamily: ${::osfamily}")
|
||||||
|
@@ -308,79 +308,61 @@ class nova::migration::libvirt(
|
|||||||
})
|
})
|
||||||
|
|
||||||
if $transport_real == 'tls' or $transport_real == 'tcp' {
|
if $transport_real == 'tls' or $transport_real == 'tcp' {
|
||||||
if versioncmp($libvirt_version, '5.6') >= 0 {
|
if versioncmp($libvirt_version, '5.6') < 0 {
|
||||||
# Since libvirt >= 5.6 and libvirtd is managed by systemd,
|
fail('libvirt verson < 5.6 is no longer supported')
|
||||||
# system socket should be activated by systemd, not by --listen option
|
|
||||||
$manage_services = pick($::nova::compute::libvirt::manage_libvirt_services, true)
|
|
||||||
|
|
||||||
if $manage_services and !$modular_libvirt_real {
|
|
||||||
# libvirtd.service should be stopped before socket service is started.
|
|
||||||
# Otherwise, socket service fails to start.
|
|
||||||
exec { 'stop libvirtd.service':
|
|
||||||
path => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],
|
|
||||||
command => 'systemctl -q stop libvirtd.service',
|
|
||||||
unless => "systemctl -q is-active libvirtd-${transport_real}.socket",
|
|
||||||
require => Anchor['nova::install::end']
|
|
||||||
}
|
|
||||||
|
|
||||||
service { "libvirtd-${transport_real}":
|
|
||||||
ensure => 'running',
|
|
||||||
name => "libvirtd-${transport_real}.socket",
|
|
||||||
enable => true,
|
|
||||||
require => Anchor['nova::config::end']
|
|
||||||
}
|
|
||||||
|
|
||||||
Exec['stop libvirtd.service'] -> Service["libvirtd-${transport_real}"] -> Service<| title == 'libvirt' |>
|
|
||||||
}
|
|
||||||
|
|
||||||
# --listen option should be disabled in newer libvirt
|
|
||||||
$libvirtd_service_listen = false
|
|
||||||
|
|
||||||
} else {
|
|
||||||
# For older libvirt --listen option should be used.
|
|
||||||
$libvirtd_service_listen = true
|
|
||||||
}
|
}
|
||||||
|
# Since libvirt >= 5.6, system socket of libvirt should be activated
|
||||||
|
# by systemd, not by --listen option
|
||||||
|
$manage_services = pick($::nova::compute::libvirt::manage_libvirt_services, true)
|
||||||
|
|
||||||
case $::osfamily {
|
if $manage_services and !$modular_libvirt_real {
|
||||||
'RedHat': {
|
# libvirtd.service should be stopped before socket service is started.
|
||||||
if $libvirtd_service_listen {
|
# Otherwise, socket service fails to start.
|
||||||
$libvirtd_args = '"--listen"'
|
exec { 'stop libvirtd.service':
|
||||||
} else {
|
path => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],
|
||||||
$libvirtd_args = ''
|
command => 'systemctl -q stop libvirtd.service',
|
||||||
}
|
unless => "systemctl -q is-active libvirtd-${transport_real}.socket",
|
||||||
|
require => Anchor['nova::install::end']
|
||||||
# NOTE(tkajinam): Since libvirt 8.1.0, the sysconfig files are
|
|
||||||
# no longer provided by packages.
|
|
||||||
file { '/etc/sysconfig/libvirtd':
|
|
||||||
ensure => present,
|
|
||||||
path => '/etc/sysconfig/libvirtd',
|
|
||||||
tag => 'libvirt-file',
|
|
||||||
}
|
|
||||||
|
|
||||||
file_line { '/etc/sysconfig/libvirtd libvirtd args':
|
|
||||||
path => '/etc/sysconfig/libvirtd',
|
|
||||||
line => "LIBVIRTD_ARGS=${libvirtd_args}",
|
|
||||||
match => '^LIBVIRTD_ARGS=',
|
|
||||||
tag => 'libvirt-file_line',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
'Debian': {
|
|
||||||
if $libvirtd_service_listen {
|
|
||||||
$libvirtd_opts = '"-l"'
|
|
||||||
} else {
|
|
||||||
$libvirtd_opts = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
file_line { '/etc/default/libvirtd libvirtd opts':
|
service { "libvirtd-${transport_real}":
|
||||||
path => '/etc/default/libvirtd',
|
ensure => 'running',
|
||||||
line => "libvirtd_opts=${libvirtd_opts}",
|
name => "libvirtd-${transport_real}.socket",
|
||||||
match => 'libvirtd_opts=',
|
enable => true,
|
||||||
tag => 'libvirt-file_line',
|
require => Anchor['nova::config::end']
|
||||||
}
|
|
||||||
}
|
}
|
||||||
default: {
|
|
||||||
warning("Unsupported osfamily: ${::osfamily}, make sure you are configuring this yourself")
|
Exec['stop libvirtd.service'] -> Service["libvirtd-${transport_real}"] -> Service<| title == 'libvirt' |>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case $::osfamily {
|
||||||
|
'RedHat': {
|
||||||
|
# NOTE(tkajinam): Since libvirt 8.1.0, the sysconfig files are
|
||||||
|
# no longer provided by packages.
|
||||||
|
file { '/etc/sysconfig/libvirtd':
|
||||||
|
ensure => present,
|
||||||
|
path => '/etc/sysconfig/libvirtd',
|
||||||
|
tag => 'libvirt-file',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_line { '/etc/sysconfig/libvirtd libvirtd args':
|
||||||
|
path => '/etc/sysconfig/libvirtd',
|
||||||
|
line => 'LIBVIRTD_ARGS=',
|
||||||
|
match => '^LIBVIRTD_ARGS=',
|
||||||
|
tag => 'libvirt-file_line',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'Debian': {
|
||||||
|
file_line { '/etc/default/libvirtd libvirtd opts':
|
||||||
|
path => '/etc/default/libvirtd',
|
||||||
|
line => 'libvirtd_opts=',
|
||||||
|
match => 'libvirtd_opts=',
|
||||||
|
tag => 'libvirt-file_line',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
warning("Unsupported osfamily: ${::osfamily}, make sure you are configuring this yourself")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Now puppet-nova requires libvirt 5.6 or later.
|
@@ -13,29 +13,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
context 'when not configuring qemu' do
|
context 'when not configuring qemu' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => false,
|
:configure_qemu => false,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
|
||||||
:context => '/files/etc/libvirt/qemu.conf',
|
|
||||||
:changes => [
|
|
||||||
"rm max_files",
|
|
||||||
"rm max_processes",
|
|
||||||
"rm group",
|
|
||||||
"rm vnc_tls",
|
|
||||||
"rm vnc_tls_x509_verify",
|
|
||||||
"rm default_tls_x509_verify",
|
|
||||||
"rm memory_backing_dir",
|
|
||||||
],
|
|
||||||
}).that_notifies('Service[libvirt]') }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when not configuring qemu with libvirt >= 4.5' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:configure_qemu => false,
|
|
||||||
:libvirt_version => '4.5',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -57,27 +35,6 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
|
||||||
:context => '/files/etc/libvirt/qemu.conf',
|
|
||||||
:changes => [
|
|
||||||
"set max_files 1024",
|
|
||||||
"set max_processes 4096",
|
|
||||||
"set vnc_tls 0",
|
|
||||||
"set vnc_tls_x509_verify 0",
|
|
||||||
"set default_tls_x509_verify 1",
|
|
||||||
],
|
|
||||||
:tag => 'qemu-conf-augeas',
|
|
||||||
}).that_notifies('Service[libvirt]') }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when configuring qemu by default with libvirt >= 4.5' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:configure_qemu => true,
|
|
||||||
:libvirt_version => '4.5',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -98,31 +55,8 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:max_files => 32768,
|
:max_files => 32768,
|
||||||
:max_processes => 131072,
|
:max_processes => 131072,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
|
||||||
:context => '/files/etc/libvirt/qemu.conf',
|
|
||||||
:changes => [
|
|
||||||
"set max_files 32768",
|
|
||||||
"set max_processes 131072",
|
|
||||||
"set vnc_tls 0",
|
|
||||||
"set vnc_tls_x509_verify 0",
|
|
||||||
"set default_tls_x509_verify 1",
|
|
||||||
],
|
|
||||||
:tag => 'qemu-conf-augeas',
|
|
||||||
}).that_notifies('Service[libvirt]') }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when configuring qemu with overridden parameters with libvirt >= 4.5' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:configure_qemu => true,
|
|
||||||
:max_files => 32768,
|
|
||||||
:max_processes => 131072,
|
|
||||||
:libvirt_version => '4.5',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -142,12 +76,11 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
context 'when configuring qemu with group parameter' do
|
context 'when configuring qemu with group parameter' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:group => 'openvswitch',
|
:group => 'openvswitch',
|
||||||
:max_files => 32768,
|
:max_files => 32768,
|
||||||
:max_processes => 131072,
|
:max_processes => 131072,
|
||||||
:memory_backing_dir => '/tmp',
|
:memory_backing_dir => '/tmp',
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -160,6 +93,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
"set default_tls_x509_verify 1",
|
"set default_tls_x509_verify 1",
|
||||||
"set group openvswitch",
|
"set group openvswitch",
|
||||||
"set memory_backing_dir /tmp",
|
"set memory_backing_dir /tmp",
|
||||||
|
"set nbd_tls 0",
|
||||||
],
|
],
|
||||||
:tag => 'qemu-conf-augeas',
|
:tag => 'qemu-conf-augeas',
|
||||||
}).that_notifies('Service[libvirt]') }
|
}).that_notifies('Service[libvirt]') }
|
||||||
@@ -169,8 +103,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:vnc_tls => true,
|
:vnc_tls => true,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -181,6 +114,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
"set vnc_tls 1",
|
"set vnc_tls 1",
|
||||||
"set vnc_tls_x509_verify 1",
|
"set vnc_tls_x509_verify 1",
|
||||||
"set default_tls_x509_verify 1",
|
"set default_tls_x509_verify 1",
|
||||||
|
"set nbd_tls 0",
|
||||||
],
|
],
|
||||||
:tag => 'qemu-conf-augeas',
|
:tag => 'qemu-conf-augeas',
|
||||||
}).that_notifies('Service[libvirt]') }
|
}).that_notifies('Service[libvirt]') }
|
||||||
@@ -189,9 +123,8 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
context 'when configuring qemu with default_tls_verify enabled' do
|
context 'when configuring qemu with default_tls_verify enabled' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:default_tls_verify => true,
|
:default_tls_verify => true,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -202,6 +135,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
"set vnc_tls 0",
|
"set vnc_tls 0",
|
||||||
"set vnc_tls_x509_verify 0",
|
"set vnc_tls_x509_verify 0",
|
||||||
"set default_tls_x509_verify 1",
|
"set default_tls_x509_verify 1",
|
||||||
|
"set nbd_tls 0",
|
||||||
],
|
],
|
||||||
:tag => 'qemu-conf-augeas',
|
:tag => 'qemu-conf-augeas',
|
||||||
}).that_notifies('Service[libvirt]') }
|
}).that_notifies('Service[libvirt]') }
|
||||||
@@ -211,9 +145,8 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:vnc_tls => true,
|
:vnc_tls => true,
|
||||||
:vnc_tls_verify => false,
|
:vnc_tls_verify => false,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -224,6 +157,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
"set vnc_tls 1",
|
"set vnc_tls 1",
|
||||||
"set vnc_tls_x509_verify 0",
|
"set vnc_tls_x509_verify 0",
|
||||||
"set default_tls_x509_verify 1",
|
"set default_tls_x509_verify 1",
|
||||||
|
"set nbd_tls 0",
|
||||||
],
|
],
|
||||||
:tag => 'qemu-conf-augeas',
|
:tag => 'qemu-conf-augeas',
|
||||||
}).that_notifies('Service[libvirt]') }
|
}).that_notifies('Service[libvirt]') }
|
||||||
@@ -232,9 +166,8 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
context 'when configuring qemu with default_tls_verify disabled' do
|
context 'when configuring qemu with default_tls_verify disabled' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:default_tls_verify => false,
|
:default_tls_verify => false,
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
@@ -245,27 +178,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
"set vnc_tls 0",
|
"set vnc_tls 0",
|
||||||
"set vnc_tls_x509_verify 0",
|
"set vnc_tls_x509_verify 0",
|
||||||
"set default_tls_x509_verify 0",
|
"set default_tls_x509_verify 0",
|
||||||
],
|
"set nbd_tls 0",
|
||||||
:tag => 'qemu-conf-augeas',
|
|
||||||
}).that_notifies('Service[libvirt]') }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when configuring qemu with nbd_tls and libvirt < 4.5' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:configure_qemu => true,
|
|
||||||
:nbd_tls => true,
|
|
||||||
:libvirt_version => '3.9',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
|
||||||
:context => '/files/etc/libvirt/qemu.conf',
|
|
||||||
:changes => [
|
|
||||||
"set max_files 1024",
|
|
||||||
"set max_processes 4096",
|
|
||||||
"set vnc_tls 0",
|
|
||||||
"set vnc_tls_x509_verify 0",
|
|
||||||
"set default_tls_x509_verify 1",
|
|
||||||
],
|
],
|
||||||
:tag => 'qemu-conf-augeas',
|
:tag => 'qemu-conf-augeas',
|
||||||
}).that_notifies('Service[libvirt]') }
|
}).that_notifies('Service[libvirt]') }
|
||||||
@@ -275,8 +188,7 @@ describe 'nova::compute::libvirt::qemu' do
|
|||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:configure_qemu => true,
|
:configure_qemu => true,
|
||||||
:nbd_tls => true,
|
:nbd_tls => true,
|
||||||
:libvirt_version => '4.5',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
it { is_expected.to contain_augeas('qemu-conf-limits').with({
|
||||||
|
@@ -418,68 +418,47 @@ describe 'nova::migration::libvirt' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'nova migration with libvirt in Debian' do
|
shared_examples_for 'nova migration with libvirt in Debian' do
|
||||||
context 'with libvirt < 5.6' do
|
context 'with tls transport' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :transport => 'tls',
|
{ :transport => 'tls' }
|
||||||
:libvirt_version => '4.0' }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
||||||
:path => '/etc/default/libvirtd',
|
:path => '/etc/default/libvirtd',
|
||||||
:line => 'libvirtd_opts="-l"',
|
:line => 'libvirtd_opts=',
|
||||||
:match => 'libvirtd_opts=',
|
:match => 'libvirtd_opts=',
|
||||||
:tag => 'libvirt-file_line',
|
:tag => 'libvirt-file_line',
|
||||||
) }
|
) }
|
||||||
it { is_expected.to_not contain_service('libvirtd-tls') }
|
it { is_expected.to contain_service('libvirtd-tls').with(
|
||||||
it { is_expected.to_not contain_service('libvirtd-tcp') }
|
:name => 'libvirtd-tls.socket',
|
||||||
|
:ensure => 'running',
|
||||||
|
:enable => true,
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with libvirt >= 5.6' do
|
context 'with tcp transport' do
|
||||||
context 'with tls transport' do
|
let :params do
|
||||||
let :params do
|
{ :transport => 'tcp' }
|
||||||
{ :transport => 'tls',
|
|
||||||
:libvirt_version => '6.0' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
|
||||||
:path => '/etc/default/libvirtd',
|
|
||||||
:line => 'libvirtd_opts=',
|
|
||||||
:match => 'libvirtd_opts=',
|
|
||||||
:tag => 'libvirt-file_line',
|
|
||||||
) }
|
|
||||||
it { is_expected.to contain_service('libvirtd-tls').with(
|
|
||||||
:name => 'libvirtd-tls.socket',
|
|
||||||
:ensure => 'running',
|
|
||||||
:enable => true,
|
|
||||||
)}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with tcp transport' do
|
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
||||||
let :params do
|
:path => '/etc/default/libvirtd',
|
||||||
{ :transport => 'tcp',
|
:line => 'libvirtd_opts=',
|
||||||
:libvirt_version => '6.0' }
|
:match => 'libvirtd_opts=',
|
||||||
end
|
:tag => 'libvirt-file_line',
|
||||||
|
) }
|
||||||
it { is_expected.to contain_file_line('/etc/default/libvirtd libvirtd opts').with(
|
it { is_expected.to contain_service('libvirtd-tcp').with(
|
||||||
:path => '/etc/default/libvirtd',
|
:name => 'libvirtd-tcp.socket',
|
||||||
:line => 'libvirtd_opts=',
|
:ensure => 'running',
|
||||||
:match => 'libvirtd_opts=',
|
:enable => true,
|
||||||
:tag => 'libvirt-file_line',
|
)}
|
||||||
) }
|
|
||||||
it { is_expected.to contain_service('libvirtd-tcp').with(
|
|
||||||
:name => 'libvirtd-tcp.socket',
|
|
||||||
:ensure => 'running',
|
|
||||||
:enable => true,
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'nova migration with libvirt in RedHat' do
|
shared_examples_for 'nova migration with libvirt in RedHat' do
|
||||||
context 'with libvirt < 5.6' do
|
context 'with tls transport' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :transport => 'tls',
|
{ :transport => 'tls' }
|
||||||
:libvirt_version => '4.5' }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
||||||
@@ -489,63 +468,38 @@ describe 'nova::migration::libvirt' do
|
|||||||
)}
|
)}
|
||||||
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(
|
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(
|
||||||
:path => '/etc/sysconfig/libvirtd',
|
:path => '/etc/sysconfig/libvirtd',
|
||||||
:line => 'LIBVIRTD_ARGS="--listen"',
|
:line => 'LIBVIRTD_ARGS=',
|
||||||
:match => '^LIBVIRTD_ARGS=',
|
:match => '^LIBVIRTD_ARGS=',
|
||||||
:tag => 'libvirt-file_line',
|
:tag => 'libvirt-file_line',
|
||||||
)}
|
)}
|
||||||
it { is_expected.to_not contain_service('libvirtd-tls') }
|
it { is_expected.to contain_service('libvirtd-tls').with(
|
||||||
it { is_expected.to_not contain_service('libvirtd-tcp') }
|
:name => 'libvirtd-tls.socket',
|
||||||
|
:ensure => 'running',
|
||||||
|
:enable => true,
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with libvirt >= 5.6' do
|
context 'with tcp transport' do
|
||||||
|
let :params do
|
||||||
context 'with tls transport' do
|
{ :transport => 'tcp' }
|
||||||
let :params do
|
|
||||||
{ :transport => 'tls',
|
|
||||||
:libvirt_version => '5.6' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:path => '/etc/sysconfig/libvirtd',
|
|
||||||
:tag => 'libvirt-file',
|
|
||||||
)}
|
|
||||||
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(
|
|
||||||
:path => '/etc/sysconfig/libvirtd',
|
|
||||||
:line => 'LIBVIRTD_ARGS=',
|
|
||||||
:match => '^LIBVIRTD_ARGS=',
|
|
||||||
:tag => 'libvirt-file_line',
|
|
||||||
)}
|
|
||||||
it { is_expected.to contain_service('libvirtd-tls').with(
|
|
||||||
:name => 'libvirtd-tls.socket',
|
|
||||||
:ensure => 'running',
|
|
||||||
:enable => true,
|
|
||||||
)}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with tcp transport' do
|
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
||||||
let :params do
|
:ensure => 'present',
|
||||||
{ :transport => 'tcp',
|
:path => '/etc/sysconfig/libvirtd',
|
||||||
:libvirt_version => '5.6' }
|
:tag => 'libvirt-file',
|
||||||
end
|
)}
|
||||||
|
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(
|
||||||
it { is_expected.to contain_file('/etc/sysconfig/libvirtd').with(
|
:path => '/etc/sysconfig/libvirtd',
|
||||||
:ensure => 'present',
|
:line => 'LIBVIRTD_ARGS=',
|
||||||
:path => '/etc/sysconfig/libvirtd',
|
:match => '^LIBVIRTD_ARGS=',
|
||||||
:tag => 'libvirt-file',
|
:tag => 'libvirt-file_line',
|
||||||
)}
|
)}
|
||||||
it { is_expected.to contain_file_line('/etc/sysconfig/libvirtd libvirtd args').with(
|
it { is_expected.to contain_service('libvirtd-tcp').with(
|
||||||
:path => '/etc/sysconfig/libvirtd',
|
:name => 'libvirtd-tcp.socket',
|
||||||
:line => 'LIBVIRTD_ARGS=',
|
:ensure => 'running',
|
||||||
:match => '^LIBVIRTD_ARGS=',
|
:enable => true,
|
||||||
:tag => 'libvirt-file_line',
|
)}
|
||||||
)}
|
|
||||||
it { is_expected.to contain_service('libvirtd-tcp').with(
|
|
||||||
:name => 'libvirtd-tcp.socket',
|
|
||||||
:ensure => 'running',
|
|
||||||
:enable => true,
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user