I''m new to Puppet (yay!) and working through having a different resolv.conf for systems that contain a certain string in their hostname. I''ve got the following in my modules/system/files.pp: class system::files { case $hostname { /^uklab*$/: { $file = "resolv-isg.conf" } default: { $file = "resolv-internal.conf" } } file { ''/etc/resolv.conf'': source => "puppet:///modules/system/$file" } } For some reason it always uses the default, what am I doing wrong? I''ve done loads of Googling around but can''t seem to find a reasonable answer. I know I could use a different module per node but didn''t want to have loads of per-node nodules but is this the only way? -- 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/-/ycBO-sSvP6sJ. 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.
On Thu, Dec 27, 2012 at 5:29 AM, Allan Mullan <ammullan@gmail.com> wrote:> I''m new to Puppet (yay!) and working through having a different resolv.conf > for systems that contain a certain string in their hostname. > > I''ve got the following in my modules/system/files.pp: > > class system::files { > case $hostname {Off the top of my head you may want to try $::fqdn instead. Thanks, Roman. -- 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.
I think you might have an error in your regex. In particular, it looks like you''re missing a ''.'', so /^uklab*$/ should probably be /^uklab.*$/ Cheers, Aaron Russo IST Infrastructure Services, Unix Group UC Berkeley --- Desk: 510-643-5550Mobile: 510-206-1532 IM: arusso@berkeley.edu (XMPP/Jabber) On Thu, Dec 27, 2012 at 5:29 AM, Allan Mullan <ammullan@gmail.com> wrote:> case $hostname { > /^uklab*$/: { > $file = "resolv-isg.conf" > } > default: { > $file = "resolv-internal.conf" > } >-- 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.