FAQ
Greetings.

When defining a "file" resource, why does the ${name} variable sometimes expand to the filename being maintained, and sometimes to the module name?

Examples (in a module which, for simplicity, we will call "apache") ...

   file { '/etc/httpd/conf/httpd.conf' :
     ensure => file ,
     source => "puppet:///modules/${module_name}${name}" ,
   }

Here $name expands to "/etc/httpd/conf/httpd.conf", so "source" expands to "puppet:///modules/apache/etc/httpd/conf/httpd.conf".

   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".

Why does $name expand differently in these cases, and where did I miss this in the documentation?

--
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

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 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