Ask Your Question

provider from puppet 3 doesn't work with puppet 4 - gem

asked 2017-05-16 07:01:23 -0500

czerwe gravatar image


i try to resurrect an own module which allows me to create kvm instances via libvirt. The module used the type/provider specs. At one point of the execution the code stops with the error

Error: /Stage[main]/Kvm/Virt[vm001]: Provider libvirt is not functional on this host

I found in the provider the line

confine :feature => :libvirt

which guided me to the line for the feature add

Puppet.features.add(:libvirt, :libs => ["libvirt"])

If i remove the libs section i get on puppet execution an

Error: /Stage[main]/Kvm/Virt[vm001]: Could not evaluate: uninitialized constant Libvirt

The module took care that the ruby-libvirt module is installed on the host. I can see it with the command

[root@ml110 tmp]# gem list --local

*** LOCAL GEMS ***

bigdecimal (1.2.0)
io-console (0.4.2)
json (1.7.7)
psych (2.0.0)
rdoc (4.0.0)
ruby-libvirt (0.5.2)

As far i can remember the puppet-agent comes with a own ruby, that whould mean that i whould have to install the ruby libs to this ruby and not to the system ones' how do i do that.

Or do i search in the wrong direction? Is it an completely different error cause?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-16 07:20:37 -0500

czerwe gravatar image

Typical, as soon i ask the question i come with the solution by myself.

the gem in the directory

/opt/puppetlabs/puppet/bin must be used to install the gem used by puppet.

If anybody else have something to add here feel free :-)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-05-16 07:01:23 -0500

Seen: 14 times

Last updated: May 16