Hello The following chunk is within a class definition. ${name} is being exchanged with an empty string: remotefile { "/${server_xml}": owner => tomcat, group => tomcat, mode => 600, source => "${ftoe_src_prefix_dev}${name}.jvm1" } However in the following chunk, lower down in the same class definition, ${name} is being exchanged with "/usr/local/tomcat/conf/ tomcat-users.xml" as I would expect: remotefile { "/usr/local/tomcat/conf/tomcat-users.xml": owner => tomcat, group => tomcat, mode => 600, source => "${ftoe_src_prefix_dev}${name}" } i can make the first one work by making the source line: source => "${ftoe_src_prefix_dev}/${server_xml}.jvm1" but I don''t know why this is necessary. Is it a bug? Or am I doing something wrong / expecting too much? Thanks Jesse
On 15/02/2007, at 5:28 PM, Jesse Reynolds wrote:> Hello > > The following chunk is within a class definition. ${name} is being > exchanged with an empty string: > > remotefile { "/${server_xml}": > owner => tomcat, group => tomcat, mode => 600, > source => "${ftoe_src_prefix_dev}${name}.jvm1" > } > > However in the following chunk, lower down in the same class > definition, ${name} is being exchanged with "/usr/local/tomcat/conf/ > tomcat-users.xml" as I would expect: > > remotefile { "/usr/local/tomcat/conf/tomcat-users.xml": > owner => tomcat, group => tomcat, mode => 600, > source => "${ftoe_src_prefix_dev}${name}" > } > > i can make the first one work by making the source line: > > source => "${ftoe_src_prefix_dev}/${server_xml}.jvm1" > > but I don''t know why this is necessary. Is it a bug? Or am I doing > something wrong / expecting too much?Actually, the ${name} in the second remotefile above doesn''t work properly either, it kind of works but the file (tomcat-users.xml) is created as a directory instead of a file. Changing:> source => "${ftoe_src_prefix_dev}${name}" >to> source => "${ftoe_src_prefix_dev}/usr/local/tomcat/conf/ > tomcat-users.xml" >makes it work correctly, however it seems that it should be unnecessary to have that long file path written out twice. Why doesn''t ${name} work here? Thanks Jesse
On Feb 15, 2007, at 12:28 AM, Jesse Reynolds wrote:> Hello > > The following chunk is within a class definition. ${name} is being > exchanged with an empty string: > > remotefile { "/${server_xml}": > owner => tomcat, group => tomcat, mode => 600, > source => "${ftoe_src_prefix_dev}${name}.jvm1" > }This will never work because $name is evaluated within the context of the class, not the context of the remotefile, so it''s actually unbound and evaluates to "". If you have a lot of these, it might be worth making another wrapper around remotefile that does that for you. -- The Ninety-Ninety Rule of Project Schedules: The first 90% of the task takes 90% of the time, and the last 10% takes the other 90%. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com