Provider autoload and gems
We currently run puppet 3.7 or 3.8 depending on the server.
About a couple of years ago we implemented a provider for managing KVM Virtual Machines.
The provider has been implemented using the gem ruby-libvirt.
Lately some of our puppets are refusing to run with the error:
Error: Could not autoload puppet/provider/libvirtnetwork/libvirt: cannot load such file -- libvirt
due to the:
The module itself ensures that the GEM is installed before the resources are managed. which normally works fine.
This error is been triggered by some of the puppets that do not instantiate this resource. Others are totally fine.
It is unclear to me what makes some of the puppets fail, i.e. I have puppets v 3.7 where it works and others in 3.7 where it fails.
The libvirt gem is only installed if they use this module. So, all puppets currently working do not have the gem installed.
I have reviewed Puppet documentation for Provider development and it does not mention about the usage of GEMS I have looked many provider examples, and most seem to call OS commands.
Any idea what could be going on?
Also, is there any guide / best practice for implementing providers that depend on Ruby bindings?