I have cloned a module for virtual machines, but when I try to apply a virtual machine to a node, I get Error: Could not find a suitable provider for virt
, which is understandable given that the contents of init.pp specify that a virtualization-capable kernel should already be running (a Xen or OpenVZ kernel).
However, with the included init.pp, I'd expect a failure message somewhere when running puppet agent --test --debug
on the node:
class virt {
fail "testfail"
case $::virtual {
/^xen/: { include virt::xen }
#/^kvm/: { include virt::kvm }
/^openvzhn/: { include virt::openvz }
}
}
But it fails with the error above, Error: Could not find a suitable provider for virt
. My node definition:
node 'hostname' {
# common is a custom module including SSH keys, works fine
include common
virt { "1001":
memory => 1024,
cpus => 4,
tmpl_cache => "debian-6.0-x86_64",
ensure => running,
virt_type => "openvz"
}
}
In the node definition, you are not using the class virt, but the custom type virt.
You'll find it in modulename/lib/puppet/type.
It needs a provider, (modulename/lib/puppet/provider) but cannot find one suitable for your system.
To include the class virt, you could use one of the following:
include virt or class ( 'virt': }
The reason it's not working; you are probably missing one of these binaries: (taken from provider)
That; or you don't have this: