On 18 April 2010 04:24, Andrew Heagle <and...@logaan.com> wrote:

> Hi,
>
> Is it possible for puppet to do the equivalent to this in bash:
> and...@comet:~$ a=1
> and...@comet:~$ x="a"
> and...@comet:~$ eval echo \$$x
> 1
>
> Or this perl:
> #!/usr/bin/perl
> $a=1;
> $x="a";
> print $$x;
> (Output would be 1)
>
> Or would I need to write a function to do this?
>

It's possible with inline_template():

dan.car...@jim ~ $ puppet
$a = 1
$x = "a"
notice("Bad:", inline_template("<%= x %>"))
notice("Good:", inline_template("<%= $x %>"))
^D
notice: Scope(Class[main]): Bad: a
notice: Scope(Class[main]): Good: 1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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