Ask Your Question
1

provision puppet variable from ruby code

asked 2014-06-20 11:26:39 -0500

wilsonwilson gravatar image

Hello,

I'm in front of a problem that i can't resolve alone.

I would like to do something like that : $myPuppetVar = <% some ruby code %>

and use $myPuppetVar in the puppet code later.

Anyone know how is it possible please?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-06-20 13:30:00 -0500

ramindk gravatar image

inline_template might be what you're looking for. I use it to do some math on facts in certain cases.

$nrpe_load = inline_template('<%= @processorcount.to_f * 1.4 %>,<%= @processorcount.to_f * 1.2 %>,<%= @processorcount.to_f * 1.0 %>')
edit flag offensive delete link more

Comments

Thank you, it works :)

wilsonwilson gravatar imagewilsonwilson ( 2014-06-23 03:58:09 -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

Stats

Asked: 2014-06-20 11:26:39 -0500

Seen: 41 times

Last updated: Jun 20 '14