Ask Your Question
0

inline_template variable result

asked 2018-09-03 03:09:44 -0500

veejay gravatar image

updated 2018-09-04 08:44:20 -0500

DarylW gravatar image

Dear All,

inline_template function executing the system command retrieving the puppet master server results.

inline_template (<%= @fqdn %>

The above gives the puppet client fqdn

inline_template(<%= `hostname` %>)

The above gives the puppet master fqdn

Is it an expected behavior?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-04 08:46:29 -0500

DarylW gravatar image

In the first case, you are resolving the value of the fqdn fact (which is passed to the puppet master) as part of the normal catalog compilation. In the second case, I believe that using the backticks executes a subshell and returns stdout from it, so in that case you are running the 'hostname' command on the box that is compiling the catalog (the master), which returns the value on that host as a string into the compiled catalog, which then would get applied on the client host.

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: 2018-09-03 03:09:44 -0500

Seen: 52 times

Last updated: Sep 04