cirrax / puppet-libvirt

puppet module for libvirt
GNU General Public License v3.0
8 stars 24 forks source link

Using libvirtd_default type fails on redhat based systems. #50

Closed rwf14f closed 3 years ago

rwf14f commented 3 years ago

Trying to set options in /etc/sysconfig/libvirtd on CentOS 7 using the default_conf hash fails with the following error message:

Error: /Stage[main]/Libvirt::Config/Libvirtd_default[LIBVIRTD_ARGS]: Could not evaluate: No ability to determine if libvirtd_default exists

The problem was introduced with PR #41 (fix libvirtd_default and update pdk #41). Changing :debian back to :ini_settings in _inisettings.rb solves it (tested only on CentOS 7 though).

trefzer commented 3 years ago

This is strange ! question: in which file did he write LIBVIRTD_ARGS (either /etc/default/libvirtd or /etc/sysconfig/libvirtd) ? because if you only changed the debian setting, I would expect, that /etc/default/libvirtd was changed which is useless on centos since /etc/sysconfig/libvirtd should be used.

rwf14f commented 3 years ago

It was written to /etc/sysconfig/libvirtd. Here's my understanding of the problem: The error is caused by the redhat specific code not finding the parent that is defined in _ini_settingsredhat.rb (Puppet::Type.type(:libvirtd_default).provider(:ini_setting)), as this is now named :debian. An alternative fix would be to change the parent to Puppet::Type.type(:libvirtd_default).provider(:debian), but this also requires to rename _inisettings.rb to debian.rb. I'd revert the change in _inisettings.rb from :debian to :ini_settings and see it as a common base, which currently matches what's required on Debian and not as a Debian specific implementation.

trefzer commented 3 years ago

uups already closed ;) @rwf14f I understand it the same way ! and I just uploaded a new version v4.3.2 which fixes the issue give me some minutes to also push it to forge.

Thank you for the issue !