$var="blabla $var1" is the way so assign it. But in puppet, you cant reassign variables values in the same scope , so once you do: $envir = "${which_envir}", You cant upcase in the same variable name $envir = upcase($envir).
Try $envir_upcase = upcase($evir) On Wed, Jan 21, 2015 at 11:24 PM, omfg9899 <linuxhpc...@gmail.com> wrote: > Hello all and thanx in advance to anyone that replies to my endless > headache here. > > I am trying to do a couple of things, and failing miserably. I will > touch on the most important one for the moment. > > I am trying to set a variable based on a variable. Effectively a dynamic > variable. I can do this in bash all day long. :/ > > class webapps_dt($envir = "${which_envir}", $envir = upcase($envir), > $agent_name = "WEBAPP_EC2EAST_$envir_SERVICE, $server = " > collector-somehost.atsome-domain.com", $version="5.5.0") { > > > The problem is, I can't figure out for the life of me how to nest or > embed that variable inside that variable. I can nest or embed a fact, but > not another variable. In case anyone is wondering, the second thing I am > trying to solve is upper casing the original fact. What I am searching for > is the environment in which the machines are built. ( dev / cert / prod ), > but I want them to be uppercase like the rest of the string. That has of > course failed too. So assuming that envir = DEV, I can't get this to work.. > > Any ideas? Thought? Miracles? > > > Thanks, > > J > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/8810c5ab-9342-4ccf-b467-f729e488f516%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/8810c5ab-9342-4ccf-b467-f729e488f516%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CALuoJ672YJTa3C5e1XcE4tbqjeS9P-uAeDrnoMuNEN8y-jz_ug%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.