If I were implementing this I would put a list of files in hiera and have my 
template dump the list into my file. My untested example is below.

Hiera:

---
psconfs:
  - al-runtime.conf
  - al-ldap.conf
  - al-cluster.conf

Puppet class (puppet 3 or higher):

class psthing ($psconfs = []) {
  file { '/path/to/conf':
    content => template('psthing/mytemplate.erb'),
  }  
}

Template:

<% @psconfs.each do |file| %>
include-and-override=${configDir}/<%= file %>
<% end %>


There's a similar example here:

http://docs.puppetlabs.com/learning/templates.html#editing-the-templates


On Fri, Jul 04, 2014 at 10:13:38AM +0200, Paolo Supino wrote:
>    Hi
>    I want to templatize (we use hiera with yaml backend) a configuration file
>    that has the following content:
>    -------------------
>    include-and-override=${configDir}/al-runtime.conf
>    include-and-override=${configDir}/al-ldap.conf
>    include-and-override=${configDir}/al-cluster.conf
>    include-and-override=${configDir}/al-jaas.conf
>    include-and-override=${configDir}/al-internal.conf
>    include-and-override=${configDir}/al-external.conf
>    -------------------
>     The number of lines and content of the include-and-override directive
>    changes between systems... 
>    Can it be done? 
>    TIA 
>    Paolo
> 
>    --
>    You received this message because you are subscribed to the Google Groups
>    "Puppet Users" group.
>    To unsubscribe from this group and stop receiving emails from it, send an
>    email to [1][email protected].
>    To view this discussion on the web visit
>    
> [2]https://groups.google.com/d/msgid/puppet-users/CA%2BB25Bw%2B_g4TQq7eUsHRzLD0JhHYOaerjVep11dYuAZNmu96Yg%40mail.gmail.com.
>    For more options, visit [3]https://groups.google.com/d/optout.
> 
> References
> 
>    Visible links
>    1. mailto:[email protected]
>    2. 
> https://groups.google.com/d/msgid/puppet-users/CA%2BB25Bw%2B_g4TQq7eUsHRzLD0JhHYOaerjVep11dYuAZNmu96Yg%40mail.gmail.com?utm_medium=email&utm_source=footer
>    3. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140704125434.GB24862%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to