I''m trying to use puppet to setup my apache v-hosts. I want to make sure the files are in order so my puppet statement is this: file { "apache-vhost-$name": path => "/etc/apache2/sites-enabled/$order-$name", content => template("apache/vhost.erb"), notify => Service[apache2]; } That creates the file /etc/apache2/sites-enabled/domain.name.tld - which is not correct. If I change the puppet manifest to read "/sites-enables/$order\-$name" then the file it creates is /etc/apache2/sites-enabled/500\-domain.name.tld - which is closer. I''m not really sure what to do in this case? -- Jon [[User:ShakataGaNai]] / KJ6FNQ http://snowulf.com/ http://www.linkedin.com/in/shakataganai <http://twitter.com/shakataganai> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Christopher Wood
2011-Nov-17 17:10 UTC
Re: [Puppet Users] Multiple variables in a file path?
On Thu, Nov 17, 2011 at 09:04:09AM -0800, Jon Davis wrote:> I''m trying to use puppet to setup my apache v-hosts. I want to make sure > the files are in order so my puppet statement is this: > � � � � file { "apache-vhost-$name": > � � � � � � � � path � �=> "/etc/apache2/sites-enabled/$order-$name", > � � � � � � � � � � � � content => template("apache/vhost.erb"), > � � � � � � � � � � � � notify �=> Service[apache2]; > � � � � � � � � }Possibly the usual variable interpretation thing? If you add curly braces to isolate the variable names that may help. file { "apache-vhost-${name}": path � �=> "/etc/apache2/sites-enabled/${order}-${name}", content => template("apache/vhost.erb"), notify �=> Service[''apache2'']; }> That creates the file /etc/apache2/sites-enabled/domain.name.tld - which > is not correct. �If I change the puppet manifest to read > "/sites-enables/$order\-$name" then the file it creates is > /etc/apache2/sites-enabled/500\-domain.name.tld - which is closer. �I''m > not really sure what to do in this case? > -- > Jon > [[User:ShakataGaNai]] / KJ6FNQ > [1]http://snowulf.com/ > [2]http://www.linkedin.com/in/shakataganai > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > References > > Visible links > 1. http://snowulf.com/ > 2. http://www.linkedin.com/in/shakataganai-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
That did it, thanks. I "couldn''t find" any examples of variable isolation in puppet, but going back now I realize there were... I just missed em. Much appreciated -Jon On Thu, Nov 17, 2011 at 09:10, Christopher Wood <christopher_wood@pobox.com>wrote:> On Thu, Nov 17, 2011 at 09:04:09AM -0800, Jon Davis wrote: > > I''m trying to use puppet to setup my apache v-hosts. I want to make > sure > > the files are in order so my puppet statement is this: > > � � � � file { "apache-vhost-$name": > > � � � � � � � � path � �=> "/etc/apache2/sites-enabled/$order-$name", > > � � � � � � � � � � � � content => template("apache/vhost.erb"), > > � � � � � � � � � � � � notify �=> Service[apache2]; > > � � � � � � � � } > > Possibly the usual variable interpretation thing? If you add curly braces > to isolate the variable names that may help. > > file { "apache-vhost-${name}": > path � �=> "/etc/apache2/sites-enabled/${order}-${name}", > content => template("apache/vhost.erb"), > notify �=> Service[''apache2'']; > } > > > That creates the file /etc/apache2/sites-enabled/domain.name.tld - > which > > is not correct. �If I change the puppet manifest to read > > "/sites-enables/$order\-$name" then the file it creates is > > /etc/apache2/sites-enabled/500\-domain.name.tld - which is closer. > �I''m > > not really sure what to do in this case? > > -- > > Jon > > [[User:ShakataGaNai]] / KJ6FNQ > > [1]http://snowulf.com/ > > [2]http://www.linkedin.com/in/shakataganai > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscribe@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > > > > References > > > > Visible links > > 1. http://snowulf.com/ > > 2. http://www.linkedin.com/in/shakataganai > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Jon [[User:ShakataGaNai]] / KJ6FNQ http://snowulf.com/ http://www.linkedin.com/in/shakataganai <http://twitter.com/shakataganai> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.