FAQ

On 2013-09-25, at 0819, Brian Lalor wrote: On Sep 25, 2013, at 8:12 AM, John Simpson 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 <jms1@voalte.com>
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 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.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 7 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 25, '13 at 12:12p
activeSep 26, '13 at 10:26p
posts7
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase