hmmm, right after sending the provious mail, I realised something:

On 23.07.2009, at 21:27, Udo Waechter wrote:

Hi,

On 23.07.2009, at 19:58, TomTom wrote:

Is it possible to do the same thing with templates?
An example of what I want to do is:

file { "/etc/sysctl.conf":
content => [
 template("sysctl.conf.$hostname.erb"),
 template("sysctl.conf.$tuningpolicy.erb"),
 template("sysctl.conf.erb"),
]
}

Unfortunately, the behaviour here is different. All templates outputs are concatenated...

see: http://reductivelabs.com/trac/puppet/wiki/FunctionReference#template



this is different call:

file{"/foo/bar":
        content => template("template1","template2")
}

yields concatenated templates.

maybe this:
file { "/etc/sysctl.conf":
content => [
  template("sysctl.conf.$hostname.erb"),
  template("sysctl.conf.$tuningpolicy.erb"),
  template("sysctl.conf.erb"),
 ]
}

works as expected, namely to select the one template that exists (or the first that exists).

dunno,
udo.


--
:: udo waechter - r...@zoide.net :: N 52º16'30.5" E 8º3'10.1"
:: genuine input for your ears: http://auriculabovinari.de
::                          your eyes: http://ezag.zoide.net
::                          your brain: http://zoide.net




Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to