Ask Your Question
0

Require on File not working

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

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
0

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

lupin gravatar image

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

edit flag offensive delete link more
0

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

lavaman gravatar image

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

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:

https://docs.puppetlabs.com/guides/pluginsinmodules.html

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

Stats

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

Seen: 57 times

Last updated: Dec 10 '15