Deployed custom facts with module do not show up

311 views
Skip to first unread message

Sergey Sudakovich

unread,
Nov 5, 2013, 4:51:22 PM11/5/13
to puppet...@googlegroups.com
When I deploy a module I wrote with couple of custom facts, those facts do not show up in factor.
But when I point FACTORLIB to the directory with those factor, they work just fine.
I am running a masterless puppet version 2.7.22 and factor 1.7.1
The module structure looks like so:

-license
---lib
-----facter
-------license.rb
-------hardware_serial.rb
-----puppet


Any idea what is causing this problem or at least where to start the debugging?

Matthaus Owens

unread,
Nov 5, 2013, 8:48:46 PM11/5/13
to puppet...@googlegroups.com
How are you deploying the module? Facter won't load module based facts by default, you need to use 'facter -p' to have Facter load those facts. 
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Matthaus Owens
Release Manager, Puppet Labs

Join us at PuppetConf 2014, September 23-24 in San Francisco

Sergey Sudakovich

unread,
Nov 6, 2013, 4:37:33 PM11/6/13
to puppet...@googlegroups.com
Do deploy the module, I just do this:
puppet module install -f license-0.1.0.tar.gz
Then to test, i run 
puppet module list
/etc/puppet/modules
└──my-license (v0.1.0)

facter -p gives me the same output and facter with no parameters.


On Tuesday, November 5, 2013 5:48:46 PM UTC-8, Matthaus Litteken wrote:
How are you deploying the module? Facter won't load module based facts by default, you need to use 'facter -p' to have Facter load those facts. 

On Tuesday, November 5, 2013, Sergey Sudakovich wrote:
When I deploy a module I wrote with couple of custom facts, those facts do not show up in factor.
But when I point FACTORLIB to the directory with those factor, they work just fine.
I am running a masterless puppet version 2.7.22 and factor 1.7.1
The module structure looks like so:

-license
---lib
-----facter
-------license.rb
-------hardware_serial.rb
-----puppet


Any idea what is causing this problem or at least where to start the debugging?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.

Matthaus Owens

unread,
Nov 6, 2013, 8:07:39 PM11/6/13
to Puppet Users
Sergey,
`facter -p` adds puppet's libdir to the load path to load module based
facts. When running against a master, facts are pluginsynced into this
directory prior to facter running. You need to make sure that the
facter directory from your module is in your puppet libdir (you can
find out what yours is set to by running `puppet agent --configprint
libdir`). So if your puppet libdir was /var/lib, your libdir should
look like the following to ensure custom facts are loaded.

var
└── lib
└── facter
├── custom_fact.rb
├── license
│ └── thing.rb
├── moar_facts.rb
├── other_fact.rb
└── root_home.rb
>>> email to puppet-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/58f49f57-f55c-425f-b408-1b286336ddb7%40googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> Matthaus Owens
>> Release Manager, Puppet Labs
>>
>> Join us at PuppetConf 2014, September 23-24 in San Francisco
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/6aa31c1c-e492-43ae-9d79-e1acc84760a0%40googlegroups.com.

Sergey Sudakovich

unread,
Nov 6, 2013, 8:27:21 PM11/6/13
to puppet...@googlegroups.com
Aha, I see so my puppet libdir is /var/lib/puppet/lib, but why when I install a module, it goes into /etc/puppet/modules?

Matthaus Owens

unread,
Nov 11, 2013, 1:55:08 PM11/11/13
to Puppet Users
/etc/puppet/modules is used for deploying needed providers, functions
and facts to agents during a catalog application. The master uses it
to serve those providers, functions, and facts and if modulepath is
passed to a puppet apply, it will also pluginsync those files to the
puppet libdir. `facter -p` only adds the puppet libdir to its load
path, so facts in the modulepath won't be available.
> https://groups.google.com/d/msgid/puppet-users/6535d35d-aef4-4dce-9675-67c5c44d3e99%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages