On 2010-08-31 17:21, Marc Zampetti wrote:

> I cannot do:
> 
>  file { "file.conf" :
>           content => [ template("module/file.conf.${hostname}"),
>                               template("module/file.conf.$
> {groupname}"),
>                               template("module/file.conf")]
>  }

You can use the file() and inline_template() functions in combination:

    $tmpl = file("/etc/puppet/modules/mymodule/file.conf.${hostname}",
                 "/etc/puppet/modules/mymodule/file.conf.${groupname}",
                 "/etc/puppet/modules/mymodule/file.conf")
    file {
        "file.conf":
            content => inline_template($tmpl);
    }

Note however that file() requires absolute pathnames.  It does not look
up files in your module path or anything, so it isn't very convenient.
I *think* there is a feature request for adding that functionality to
file(), though, but I don't have time to search for it at the moment.


        /Bellman

-- 
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