I'm having trouble getting a simple custom type to work.
Clients are giving me the following error:
"Could not retrieve catalog: Could not find resource type zypper_repo
at /etc/puppet/manifests/nodes/mgt.pp:33 on node <host.fqdn>"
The custom type is present in the /var/lib/puppet/lib/puppet/type
directory on both clients and server (via pluginsync), but it's not
working.
My node.pp, init.pp for the module, and custom type are listed below.
Any ideas?
node 'host.fqdn' inherits basenode {
include zypper
zypper_repo { "test":
}
}
init.pp for zypper module:
class zypper {
}
zypper_repo.rb:
module Puppet
newtype(:zypper_repo) do
@doc = "Ensure that the given repo is defined on the system,
and add it if not present."
ensurable
newparam(:name) do
desc "The name of the repository"
isnamevar
end
newparam(:enabled) do
desc "Enabled status of the repository"
newvalues(:yes, :no)
defaultto "yes"
end
newparam(:refresh) do
desc "Refresh status of the repository"
newvalues(:yes, :no)
defaultto "yes"
end
newparam(:type) do
desc "Type of repository"
newvalues(:yum, :yast, :plaindir)
end
newparam(:uri) do
desc "URI that points to the repository"
end
newproperty(:ensure) do
desc "Whether the repository is present or not."
newvalue :outofsync
newvalue :insync
end
newproperty(:ensure) do
desc "Whether the repository is present or not."
newvalue :outofsync
newvalue :insync
defaultto :insync
def retrieve
cmdline = 'zypper sl | grep ' + resource[:name]
result = `#{cmdline}`
result.split[0] ? :insync : :outofsync
end
end
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---