Manish Chakravarty
unread,Apr 19, 2009, 9:11:53 AM4/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Puppet Developers, brian...@gmail.com
Hello everyone,
I am working on developing a monit provider for puppet but I seem to
have run into a (simple) issue.
I have defined a new property called "pid" which I want to be able to
specify in site.pp
Here's my current site.pp
node default
{
monit
{
"mongrel":
pid = > "manish",
ensure => present,
target => "/home/manish/monitrc",
}
}
This is the error trace
manish@manish-laptop:~$ sudo puppetd --server manish-laptop --test --
verbose
info: Retrieving plugins
err: /File[/var/lib/puppet/lib]: Failed to generate additional
resources during transaction: Cannot access mount[plugins]
err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
resource: Cannot access mount[plugins] Could not describe /plugins:
Cannot access mount[plugins]
info: Caching catalog at /var/lib/puppet/state/localconfig.yaml
notice: Starting catalog run
notice: //Node[default]/Monit[mongrel]/ensure: created
err: Got an uncaught exception of type ArgumentError: Field 'pid' is
required
info: Sent transaction report in 0.15 seconds
notice: Finished catalog run in 0.21 seconds
Here's my monit.rb
=============
module Puppet
newtype(:monit) do
@doc = "Manages monitrc"
ensurable
newparam(:processName, :namevar => true ) do
desc "The process to manage eg: mongrel_8001"
isnamevar
end
newproperty(:pid) do
desc "Location of the monitrc file file"
end
newproperty(:target) do
desc "Location of the monitrc file file"
defaultto { if
@resource.class.defaultprovider.ancestors.include?
(Puppet::Provder::ParsedFile)
@resource.class.defaultprovider.default_target
else
nil
end
}
end
end
end
============
and here's my parsed.rb
=================
require 'puppet/provider/parsedfile'
Puppet::Type.type(:monit).provide(:parsed,
:parent => Puppet::Provider::ParsedFile,
:default_target => '',
:filetype => :flat
) do
desc "The monit provider that uses the ParsedFile class"
text_line :comment, :match => /^#/;
text_line :blank, :match => /^\s*$/;
record_line :parsed, :fields => %w{name pid}
end
================
I think I am doing something wrong here.
Is the way that I have define the "pid" property wrong ( please see my
monit.rb )
Can someone help me resolve this ?
Thanks in advance!
Manish Chakravarty