Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Is it possible to eval (compute) class parameters from ENC ?

$
0
0
Let's say I have a parameter with a default value, like class example ( $param = $name ? {/foo/ => "foo", default => "bar"}, ) If I don't override this parameter in my ENC (in my case, in foreman), everything happens as expected : the "$param" value depends on the value of "$name", and is either "foo" or "bar". But if the value is overrided in the ENC with the same kind of thing, it seems that it's not interpreted (evaluated); for example, if I set it to "$name"; my ENC is : --- classes: example: param: $name [...] (Note that the value is not quoted) and when I print the value of "param" in a file, it puts "$name" (not the value of name, just "$name", as in the ENC, without quotes). I understand why the devs wanted this to not work; most of the time, if we override something, it is to set a constant. But in my case, it will be verty handy if it was possible to force the computation of the value from ENC, just like with default value. PS: I would be interested even if I have to modify puppet code a little bit;

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>