Hello all, sort of a puppet newbie here,

I have some constructs that are like so:

class hosts {
   file {"/etc/hosts":
      owner  => root,
      group  => root,
      mode   => 644,
      source => ["puppet://puppet/files/etc/hosts.$hostname",
                 "puppet://puppet/files/etc/hosts.$operatingsystem",
                 "puppet://puppet/files/etc/hosts"]
   }
}

And I have lots of them, for various reasons.  It seems like a real
waste to have to keep on typing out those 3-5 lines for where the
source of these things are from.  So I thought I could do something
like the following.  Having all those variables in one place, being
able
to add to the search path easily:

$base = "puppet://puppet.foo.bar/files"

$search = [
  "${base}/${host}",
  "${base}/${operatingsystem}",
  "${base}/default"
]

class hosts {
   file {"/etc/hosts":
      owner  => root,
      group  => root,
      mode   => 644,
      source => "${search}/etc/hosts";
   }
}


But that definitely does not do what I thought it would.  Anyone have
a method of
making the above type of thing work?

-Toby.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to