I''m trying to create a new type.. I followed the example on the wiki
and I have for the the type
module Puppet
newtype(:append_if_no_such_line) do
@doc = "Ensure that the given line is defined in the file, and append
the line to the end of the file if the line isn''t already
in
the file."
newparam(:name) do
desc "The name of the resource"
isnamevar
end
newparam(:file) do
desc "The file to examine (and possibly modify) for the line."
end
newparam(:user) do
desc "The user"
end
newparam(:line) do
desc "The line we''re interested in."
end
newproperty(:ensure) do
desc "Whether the resource is in sync or not."
defaultto :insync
def retrieve
File.readlines(resource[:file]).map { |l|
l.chomp
}.include?(resource[:line]) ? :insync : :outofsync
end
newvalue :outofsync
newvalue :insync do
File.open(resource[:file], ''a'') { |fd| fd.puts
resource[:line] }
end
end
end
end
My manifest is this
append_if_no_such_line { "foobar":
file => "/tmp/foobar.txt",
line => "some line of text",
user => "test",
ensure => insync,
}
The error is
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Invalid parameter user at
/etc/puppet/manifests/modules/brsoft/manifests/history.pp:11 on node
history-v01-00a.domain.com
If i remove the user part from the manifest, it works just fine.. i''m
scratching my head a bit
thanks
mike
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.