Behavior of local modules and their included facts

7 views
Skip to first unread message

windowsrefund

unread,
Jan 18, 2011, 12:23:59 PM1/18/11
to Puppet Users
I've got a simple local module that I'll be compiling with the puppet
binary. The module's structure is:

modules/ub/
modules/ub/manifests
modules/ub/manifests/init.pp
modules/ub/lib
modules/ub/lib/facter
modules/ub/lib/facter/factery_import.rb

modules/ub/manifests/init.pp is just a placeholder:

class ub {
}

My expectation is that I'd be able to run the puppet binary as follows
and the factery_import.rb script would run

puppet -d --modulepath=modules -e 'include ub'

This does not work though. I can work around it by using export
FACTERLIB=modules/ub/lib/facter but I'd like to avoid that if at all
possible. Am I missing something obvious here?

Thanks in advance

Daniel Pittman

unread,
Jan 18, 2011, 3:07:03 PM1/18/11
to puppet...@googlegroups.com

No, that looks like it should work to me. Specifically, by testing
with 2.6.4 shows that it actually works correctly when I run that some
code; puppet loads the fact and I see my debug output showing that it
was found.

Can you post the versions and put the code up to download? If you do
we can try out the system and see if it will reproduce for us locally.
(Knowing exactly what version of puppet you have will also help,
because it will let me test the same code you use rather than just
whatever I have on my system.)

Regards,
Daniel
--
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <dan...@rimspace.net>
✆ Contact me via gtalk, email, or phone: +1 (503) 893-2285
♲ Made with 100 percent post-consumer electrons

windowsrefund

unread,
Jan 18, 2011, 4:24:05 PM1/18/11
to Puppet Users
Daniel,

Thanks for the assistance. I dropped a tarball over at
https://bitbucket.org/windowsrefund/temp/src/31bfb4826c7f/ub2.tar.gz

after extracting, I'd be able to reproduce the problem with:

cd ub2
puppet -d --modulepath=modules init.pp

As for versions, here's what I'm doing:

puppet 0.25.4 (gem)
facter 1.5.8 (gem)
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
some sort of debianish GNU/Linux OS

Thanks again and let me know if further details are needed.

Adam

Daniel Pittman

unread,
Jan 18, 2011, 5:33:59 PM1/18/11
to puppet...@googlegroups.com
On Tue, Jan 18, 2011 at 13:24, windowsrefund <window...@gmail.com> wrote:

> Thanks for the assistance. I dropped a tarball over at
> https://bitbucket.org/windowsrefund/temp/src/31bfb4826c7f/ub2.tar.gz
> after extracting, I'd be able to reproduce the problem with:

[...]

> As for versions, here's what I'm doing:
>
> puppet 0.25.4 (gem)
> facter 1.5.8 (gem)
> ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
> some sort of debianish GNU/Linux OS
>
> Thanks again and let me know if further details are needed.

No, that covers it, actually. Your problem is that the 0.25.4 series
consult only '.../ub2/plugins/facter/*.rb' for custom facts; the
'.../ub2/lib/facter/*.rb' version didn't come in until later. (The
2.6 AKA 0.26 series, IIRC, but I have not checked exactly when.)

For backward compatibility the newer clients will fetch from
plugins/facter as well as lib/facter, so the compatible option is to
drop it in there.

Were you working from some documentation on modules on our site? If
so I would love to know where, because then I can tell our tech writer
to fix it up so that it makes absolutely clear which versions the
various paths work in. :)

windowsrefund

unread,
Jan 18, 2011, 6:24:35 PM1/18/11
to Puppet Users
Daniel,

Thanks for the feedback. The doc I referred to lives at
http://docs.puppetlabs.com/guides/plugins_in_modules.html

I'll certainly try a mv lib plugins to see if it works as expected but
I'm a little confused when I consider my existing source tree which
does use the lib directory. Of course, this is client/server stuff
where the scenario being discussed here is purely local.

All the best

Daniel Pittman

unread,
Jan 18, 2011, 6:29:31 PM1/18/11
to puppet...@googlegroups.com
On Tue, Jan 18, 2011 at 15:24, windowsrefund <window...@gmail.com> wrote:

> Thanks for the feedback. The doc I referred to lives at
> http://docs.puppetlabs.com/guides/plugins_in_modules.html

Thanks. I will bug our tech writer in a moment. :)

> I'll certainly try a mv lib plugins to see if it works as expected but
> I'm a little confused when I consider my existing source tree which
> does use the lib directory. Of course, this is client/server stuff
> where the scenario being discussed here is purely local.

I only looked at the client-side behaviour, not the master. With the
master it depends where that system scans through for pluginsync – it
then sends 'em all to a single directory on the client that is on the
search path in addition to the module directories.

Is your puppet master also an 0.25 series install, or are you using a
2.6 master and 0.25 clients?

windowsrefund

unread,
Jan 18, 2011, 6:34:41 PM1/18/11
to Puppet Users



> Is your puppet master also an 0.25 series install, or are you using a
> 2.6 master and 0.25 clients?

Everything is 0.25.4

windowsrefund

unread,
Jan 18, 2011, 6:42:16 PM1/18/11
to Puppet Users

>
> No, that covers it, actually.  Your problem is that the 0.25.4 series
> consult only '.../ub2/plugins/facter/*.rb' for custom facts; the
> '.../ub2/lib/facter/*.rb' version didn't come in until later.  (The
> 2.6 AKA 0.26 series, IIRC, but I have not checked exactly when.)
>

Looks like the mv lib plugins fix did not result in the fact loading.
It seems to only be possible if I point FACTERLIB at the exact path.

windowsrefund

unread,
Jan 18, 2011, 6:50:00 PM1/18/11
to Puppet Users

>
> Looks like the mv lib plugins fix did not result in the fact loading.
> It seems to only be possible if I point FACTERLIB at the exact path.

Sorry for the false positive. All is good with using plugins rather
than lib on 0.25.4

Thanks again :)

Nigel Kersten

unread,
Jan 18, 2011, 7:06:46 PM1/18/11
to puppet...@googlegroups.com

That's definitely a bug. We moved to supporting lib/ in 0.25.x, we
just must have missed making this work on the client side.

>
> Thanks again :)
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>

Nick Fagerlund

unread,
Jan 21, 2011, 12:40:56 PM1/21/11
to Puppet Users
On Jan 18, 4:06 pm, Nigel Kersten <ni...@puppetlabs.com> wrote:
> That's definitely a bug. We moved to supporting lib/ in 0.25.x, we
> just must have missed making this work on the client side.

Specifically, it looks like bug 4180 (http://projects.puppetlabs.com/
issues/4180). This was never fixed in 0.25.x, right? Should we re-open
or file a new ticket?

(Also, should this bug be mentioned in the documentation?)

Nigel Kersten

unread,
Jan 23, 2011, 5:18:09 PM1/23/11
to puppet...@googlegroups.com

We're not going to do another 0.25.x release, so we should mention it
in the docs.

Reply all
Reply to author
Forward
0 new messages