Expose log_outputs parameter for libvirt
This allows us to configure where the libvirt logs end up, as described in the documentation: https://libvirt.org/logging.html Change-Id: Ia74e138aeeb1e09e253707de70ea9d0a4344ad1a
This commit is contained in:
@@ -126,6 +126,11 @@
|
|||||||
# you actually want to deploy.
|
# you actually want to deploy.
|
||||||
# Defaults to true for backward compatibility.
|
# Defaults to true for backward compatibility.
|
||||||
#
|
#
|
||||||
|
# [*log_outputs*]
|
||||||
|
# (optional) Defines log outputs, as specified in
|
||||||
|
# https://libvirt.org/logging.html
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
class nova::compute::libvirt (
|
class nova::compute::libvirt (
|
||||||
$ensure_package = 'present',
|
$ensure_package = 'present',
|
||||||
$libvirt_virt_type = 'kvm',
|
$libvirt_virt_type = 'kvm',
|
||||||
@@ -150,6 +155,7 @@ class nova::compute::libvirt (
|
|||||||
$compute_driver = 'libvirt.LibvirtDriver',
|
$compute_driver = 'libvirt.LibvirtDriver',
|
||||||
$preallocate_images = $::os_service_default,
|
$preallocate_images = $::os_service_default,
|
||||||
$manage_libvirt_services = true,
|
$manage_libvirt_services = true,
|
||||||
|
$log_outputs = undef,
|
||||||
) inherits nova::params {
|
) inherits nova::params {
|
||||||
|
|
||||||
include ::nova::deps
|
include ::nova::deps
|
||||||
@@ -180,6 +186,12 @@ class nova::compute::libvirt (
|
|||||||
include ::nova::migration::libvirt
|
include ::nova::migration::libvirt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $log_outputs {
|
||||||
|
libvirtd_config {
|
||||||
|
'log_outputs': value => "\"${log_outputs}\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# manage_libvirt_services is here for backward compatibility to support
|
# manage_libvirt_services is here for backward compatibility to support
|
||||||
# deployments that do not include nova::compute::libvirt::services
|
# deployments that do not include nova::compute::libvirt::services
|
||||||
#
|
#
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The parameter log_outputs in the libvirt manifest has been expose in order
|
||||||
|
to be able to configure where the libvirtd logs end up (which could be in
|
||||||
|
multiple places depending on the value for that parameter). It configures
|
||||||
|
the configuration value with the same name, as explained in the
|
||||||
|
documentation - https://libvirt.org/logging.html
|
@@ -81,6 +81,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
:virtlog_service_name => 'virtlog',
|
:virtlog_service_name => 'virtlog',
|
||||||
:compute_driver => 'libvirt.FoobarDriver',
|
:compute_driver => 'libvirt.FoobarDriver',
|
||||||
:preallocate_images => 'space',
|
:preallocate_images => 'space',
|
||||||
|
:log_outputs => '1:file:/var/log/libvirt/libvirtd.log'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -102,6 +103,7 @@ describe 'nova::compute::libvirt' do
|
|||||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
|
||||||
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
|
||||||
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
|
||||||
|
it { is_expected.to contain_libvirtd_config('log_outputs').with_value("\"#{params[:log_outputs]}\"")}
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_service('libvirt').with(
|
is_expected.to contain_service('libvirt').with(
|
||||||
:name => 'custom_service',
|
:name => 'custom_service',
|
||||||
|
Reference in New Issue
Block a user