On 2012-25-08 1:02, Nick Fagerlund wrote:
    - Can I write more complex expressions in an interpolation? Can I do
    something like "The sum is ${$a + $b}", and if that is the case, is it
    possible to have any expression interpolated (including nested strings
    with interpolation)?


Nope! Thanks for reminding me about this, I remember trying to make
Puppet do this and being disappointed.

I just tested on puppet 2.7.14...

puppet apply -e '$x = 1 $y =2 $b="x${$x+$y}x" notice($b)'
notice: Scope(Class[main]): x3x
notice: Finished catalog run in 0.01 seconds

And

puppet apply -e '$x = 1 $y =2 $b="x${"abc${$x+$y}abc"}x" notice($b)'
notice: Scope(Class[main]): xabc3abcx
notice: Finished catalog run in 0.01 seconds

So - seems to work just fine - at least simple, complex things :)

- henrik

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to