On 2013-09-25, at 0819, Brian Lalor <[email protected]> wrote:
On Sep 25, 2013, at 8:12 AM, John Simpson <[email protected]> wrote:
> 
>> file { '/etc/httpd/conf.d/ssl.conf' :
>>   ensure  => file ,
>>   content => template ( "${module_name}{$name}.erb" ) ,
>> }
>> 
>> Here $name expands to "apache", so the filename passed to template() is 
>> "apacheapache.erb", rather than the expected and desired value 
>> "apache/etc/httpd/conf.d/ssl.conf.erb".
> 
> Is this the literal syntax?  Because you have "{$name}" instead of "${name}". 
>  I can't explain why the former would expand the way it does, unless the 
> braces around the variable name have special meaning.  I would expect you'd 
> get the literal braces in the expanded value.  Not a real answer, but it does 
> look unintentional.

Sorry, I tried to remove a bunch of extraneous detail from my first message and 
fat-fingered the variable.

The actual syntax, copied and pasted from the module, is:

  file { '/etc/httpd/conf.d/ssl.conf' :
    ensure  => file ,
    mode    => 0644 ,
    owner   => 0 ,
    group   => 0 ,
    content => template ( "${module_name}${name}.erb" ) ,
    notify  => Service['httpd'] ,
    require => Package['httpd'] ,
  }

When I try to apply this on my test machine, I get...

# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not find template 'apacheapache.erb' at 
/home/jms1/puppet/apache/manifests/init.pp:21 on node xxx
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

--
John Simpson <[email protected]>
Unix System/VM Developer and Engineering Operations, Voalte
+1 (941) 312-2830 x148

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to