Ask Your Question

How to correctly look up a fact in a template?

asked 2013-09-01 00:51:17 -0500

Which is more correct when looking up a fact (::is_pe) inside an ERB template?

<% if @is_pe == 'true' %>


<% if scope.lookupvar('::is_pe') == 'true' %>
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-09-01 02:10:24 -0500

Ancillas gravatar image

If you're using ::ispe, then it's out of scope of your module, and you should use the latter approach (scope.lookupvar). If ispe is in scope (defined in your module), then use the former examle (@is_pe).

edit flag offensive delete link more



Referencing Variables seems to imply that ::is_pe will be available as @is_pe. I also remember a conversation on #puppet that said that a fact value (::is_pe) will always override a ...(more)

razorsedge gravatar imagerazorsedge ( 2013-09-01 15:11:40 -0500 )edit

"This can also be used to ensure that you are getting the top-scope value of a variable that may have been overridden in a local scope:". Local scope takes precedence ...(more)

Ancillas gravatar imageAncillas ( 2013-09-01 23:08:19 -0500 )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

1 follower


Asked: 2013-09-01 00:51:17 -0500

Seen: 1,686 times

Last updated: Sep 01 '13