Ask Your Question

Ensure exec runs before "if fact equals..." condition

asked 2013-09-26 08:47:20 -0600

tsheriffk gravatar image

I am using Foreman/Puppet along with RH Satellite to try and ensure my systems are in the software channel that I have defined within Foreman, and on new builds it patches them from the defined channel. My issue is that I need to somehow make sure that my local fact exists first prior to having it perform the comparison with my "if" statement..

The commands all work properly on their own, but I can't figure out what would work to do ordering, to ensure that prior to it performing the comparison, it does the exec to make sure ... (more)

edit retag flag offensive close merge delete


Hmm.... well I should have tested it a little better.. I am able to get the expected results, as when it goes thru the decision of if the custom fact ...(more)

tsheriffk gravatar imagetsheriffk ( 2013-09-26 10:26:04 -0600 )edit

I re-opened your question because I think it has value for understanding how different types of custom facts are evaluated. Let me know if you disagree.

Ancillas gravatar imageAncillas ( 2013-09-26 10:41:37 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-26 10:32:10 -0600

Ancillas gravatar image

I don't this this will work with an external fact, but anyone feel free to correct me. Facts are evaluated before the catalog is requested by the master, so your new fact in basechannel.txt won't be read until your next Puppet run. If you re-write your fact to be a Ruby fact, and use pluginsync, then I think the fact could be run before hand.

edit flag offensive delete link more


I just confirmed with binford2k in IRC that pluginsync runs before the agent requests a catalog on the master, so a Ruby fact will be downloaded prior to the first ...(more)

Ancillas gravatar imageAncillas ( 2013-09-26 10:39:48 -0600 )edit

Looks like Ken filed a feature request to sync external facts via pluginsync.

Ancillas gravatar imageAncillas ( 2013-09-26 10:40:01 -0600 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-09-26 08:47:20 -0600

Seen: 569 times

Last updated: Sep 26 '13