Here''s what I''ve been doing, fwiw:
file { ''nsswitch.conf'':
path => ''/etc/nsswitch.conf'',
content => inline_template(
file(
"/etc/puppet/modules/dist/ldapclient/templates/etc/nsswitch.conf.$hostname.erb",
"/etc/puppet/modules/dist/ldapclient/templates/etc/nsswitch.conf.$deviceid.erb",
"/etc/puppet/modules/dist/ldapclient/templates/etc/nsswitch.conf.$clientid.erb",
"/etc/puppet/modules/dist/ldapclient/templates/etc/nsswitch.conf.erb")),
ensure => file,
owner => root, group => 0, mode => 0644;
}
not sure about the elegance or lack thereof, contained within, but it seems to
work until there''s a "better way"(™) to do it
W
On Sep 1, 2011, at 9:09 AM, Nigel Kersten wrote:
On Wed, Aug 31, 2011 at 10:48 PM, Sam Morrison
<sorrison@gmail.com<mailto:sorrison@gmail.com>> wrote:
Hi,
In a file resource I want to be able to specify multiple template contents. If
the 1st template doesn''t exist use the 2nd listed and so on. Much like
how the source attribute works.
Basically this:
file { "/tmp/somefile.txt":
ensure => present,
content => [
template("somefile-$fqdn.erb"),
template("somefile.erb"),
]
mode => 644,
owner => root,
group => root,
}
Which doesn''t work. Is there a way to do this in puppet?
Unfortunately the template and file functions treat multiple values differently.
File uses them for fallbacks, Template concats the .erb files together.
This is something we''d quite like to fix, and the solution is probably
going to involve a separate concatenation function, but changing how template
works is somewhat problematic for backwards compatibility. Perhaps an
''erb'' function that behaves like ''template''
is a better solution...
http://projects.puppetlabs.com/issues/5158
Thanks,
Sam
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/mVbZoOdhVp8J.
To post to this group, send email to
puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com<mailto:puppet-users%2Bunsubscribe@googlegroups.com>.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
--
Nigel Kersten
Product Manager, Puppet Labs
Join us for PuppetConf
<http://www.bit.ly/puppetconfsig>
Sept 22/23 Portland, Oregon, USA.
--
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<mailto:puppet-users@googlegroups.com>.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com<mailto:puppet-users+unsubscribe@googlegroups.com>.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
________________________________
This message may contain confidential or privileged information. If you are not
the intended recipient, please advise us immediately and delete this message.
See http://www.datapipe.com/about-us-legal-email-disclaimer.htm for further
information on confidentiality and the risks of non-secure electronic
communication. If you cannot access these links, please notify us by reply
message and we will send the contents to you.
--
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.