On Sep 17, 2008, at 1:12 PM, Steve McIntosh wrote:
>
> On Sep 16, 2008, at 11:18 PM, Luke Kanies wrote:
>
>> Can you be specific on what kinds of errors you're seeing?
>
> That's part of the problem. No errors posted, things just don't work.
Here's a quick pointer to the couple of problems I see; if they're not
sufficient, then please let me know.
>
> Full (if contrived) example:
> [...]
>
> The custom type append_if_no_such line. Straight out of the puppet
> documentation with the addition of the "require" and a call to the
> "Foo" class inside the "insync" block.
>
> - start /var/lib/puppet/lib/puppet/types/append_if_no_such_line.rb -
> require "Foo"
This should normally be "require 'foo'" (lower-case, to match the case
of the file name), but most importantly, you need to put the custom
type in lib/puppet/type (not the singular).
[...]
> BTW, I've put the Foo.rb file just about everywhere I can think
> of and done every include and require I could think of. I even
> wrapped it with "module puppet" and put it everywhere, etc.
>
> Anyhow, with the above files in the places mentioned, I add
> the following node to site.pp:
>
> node 'pinocchio.endpoint.com' {
> append_if_no_such_line{ 'test':,
> file => '/tmp/splat',
> line => 'foobar'
> }
> }
>
> Then I go to the pinocchio machine and run puppetd:
>
> [EMAIL PROTECTED] ~]# cat /tmp/splat
> nope
> [EMAIL PROTECTED] ~]# puppetd --test
> info: Retrieving plugins
> notice: Ignoring cache
> info: Caching catalog at /var/lib/puppet/localconfig.yaml
> notice: Starting catalog run
> notice: Finished catalog run in 0.06 seconds
> [EMAIL PROTECTED] ~]# cat /tmp/splat
> nope
If you're not getting an error, then Puppet is either not seeing the
code above, it's seeing a defined type (written in Puppet's language,
rather than ruby) with the same name, or it's seeing the custom type
but the type isn't doing what you want.
There's essentially no way for Puppet to not find the type in question
but not have an error either, and you should be able to confirm that
by looking int he localconfig.yaml file -- if that append_if_...
resource is in that file, then you've got a functional problem with
your type, if it's not, then, um, something ridiculous is happening.
Either way, you should have an error from Puppet if Puppet can't find
that type.
--
Tradition is what you resort to when you don't have the time or the
money to do it right. -- Kurt Herbert Alder
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---