Facts with puppet master --compile

618 views
Skip to first unread message

Yushu Yao

unread,
May 31, 2011, 7:31:02 PM5/31/11
to puppet-users
Hi Experts,

Sorry for re-posting but I wasn't able to get a definite answer.

I noticed there was an issue opened about this (And some posts).  https://projects.puppetlabs.com/issues/3646

Just wondering what is the best way today to pass facts to puppet master --compile?

As suggested in the ticket above, puppet master —compile ${client_fqdn} —factsfile ${file_full_of_facts} will be great!

Thanks a lot!

-Yushu

+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| 1 Cyclotron Road
| Berkeley CA 94720 - USA
+-------------------------------------------------+


Patrick

unread,
May 31, 2011, 8:11:17 PM5/31/11
to puppet...@googlegroups.com

On May 31, 2011, at 4:31 PM, Yushu Yao wrote:

Hi Experts,

Sorry for re-posting but I wasn't able to get a definite answer.

I noticed there was an issue opened about this (And some posts).  https://projects.puppetlabs.com/issues/3646

Just wondering what is the best way today to pass facts to puppet master --compile?

As suggested in the ticket above, puppet master —compile ${client_fqdn} —factsfile ${file_full_of_facts} will be great!

I know that the master will cache the facts for clients at "/var/lib/puppet/yaml/facts".  What if you pre-populate the facts cache on the master?

Nan Liu

unread,
May 31, 2011, 8:41:25 PM5/31/11
to puppet...@googlegroups.com
On Tue, May 31, 2011 at 4:31 PM, Yushu Yao <yy...@lbl.gov> wrote:
> Hi Experts,
>
> Sorry for re-posting but I wasn't able to get a definite answer.
>
> I noticed there was an issue opened about this (And some posts).
> https://projects.puppetlabs.com/issues/3646
>
> Just wondering what is the best way today to pass facts to puppet master
> --compile?

Supply the client yaml facts in $vardir/yaml/ directory, matching the
client certname.

facter --yaml output isn't actually valid, this script should generate
the right data from the agent:

#!/usr/bin/env ruby

require 'puppet'
result = Puppet::Node::Facts.new(Puppet[:certname].to_s, Facter.to_hash)
result.add_local_facts
result.stringify
result.downcase_if_necessary
puts result.to_yaml

Thanks,

Nan

Yushu Yao

unread,
May 31, 2011, 11:47:51 PM5/31/11
to puppet...@googlegroups.com
Thanks a lot Nan!

I'll give it a try! And let the list know if it works.

-Yushu

+-------------------------------------------------+
| Yushu Yao
| Ph:1-510-486-4690 
|
| Lawrence Berkeley National Lab
| 1 Cyclotron Road
| Berkeley CA 94720 - USA
+-------------------------------------------------+





--
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.


Reply all
Reply to author
Forward
0 new messages