Hi all, I have written the following code... $someendpoint1="12345" $someendpoint2="54321" $prop = "/app/tcs/temp.properties" file{''temp.properties'': path =>"$prop", ensure =>''present'', content =>"$someendpoint1=http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs $someendpoint2=http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs" } actually i want to apply variables to the link..when am trying to do that am getting an error. How can i assign the variables to link??? Can sum one please help me with it. -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Matthew Pounsett
2013-Jan-29 16:12 UTC
[Puppet Users] Re: How to assign variable for an URL
On Tuesday, 29 January 2013 02:05:30 UTC-5, yarlagadda ramya wrote:> > Hi all, > > I have written the following code... > > $someendpoint1="12345" > $someendpoint2="54321" > $prop = "/app/tcs/temp.properties" > > file{''temp.properties'': > path =>"$prop", > ensure =>''present'', > content =>"$someendpoint1=http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs > $someendpoint2=http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs" > } > > actually i want to apply variables to the link..when am trying to do that > am getting an error. How can i assign the variables to link??? > >If I understand your request properly.. just the same as you''re applying variables elsewhere. $someendpoint1="12345" $someendpoint2="54321" $prop = "/app/tcs/temp.properties" $uri_path = "/ersfrsdrs/sdersrsrs" file{''temp.properties'': path =>"$prop", ensure =>''present'', content =>"$someendpoint1=http://sdrhuiswresw:8080/<http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs> $uri_path $someendpoint2=http://sdrhuiswresw:8080/<http://sdrhuiswresw:8080/ersfrsdrs/sdersrsrs> $uri_path" If you have a case where the variable name is ambiguous because it''s up against another string that could be part of the variable:. e.g. $foo = "super" $bar = "$foostar" Then you have to enclose the variable name in curly quotes to remove the ambiguity: $foo = "super" $bar = "${foo}star" Some people consider it good style to do this all the time. However, I''m only guessing at what errors you might be seeing. If you could supply the real example of what you''re trying to do, with the error you''re getting, it would make it easier to give you specific advice. -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.