Ask Your Question

Require on File not working

asked 2015-12-10 04:20:18 -0600

saargrin gravatar image

So i want to add custom facts to facter

Below code sample doesnt print on first run, but does print on the second run correctly , despite the "require" clause What am i missing?

class glb2{ file { "/usr/lib/ruby/site_ruby/1.8/facter/pontis.rb": source => "puppet:///files/runtime/pont.rb", }

notify{"Buildtime $::buildtime": require=> File["/usr/lib/ruby/site_ruby/1.8/facter/pont.rb"]} }

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-12-10 12:06:34 -0600

lupin gravatar image

Put your pontis.rb file to <module_name>/lib/puppet/facter

edit flag offensive delete link more

answered 2015-12-10 16:04:18 -0600

lavaman gravatar image

updated 2015-12-10 16:06:09 -0600

You should allow puppet to automatically add your custom fact via pluginsync. This will allow it to be present before the first run of facter. Place it in the lib/facter directory in your module. You'll also need to ensure that your puppet.conf has pluginsync set to true. More info is available here:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-12-10 04:09:17 -0600

Seen: 68 times

Last updated: Dec 10 '15