On Thu, Oct 23, 2014 at 8:50 AM, Trey Ormsbee <[email protected]> wrote:

> I working with a dynamic config file template,  I have a section for
> global options,  then a dynamic section that i want to populate with
> multiple defined entries.
>
> example config file
>
> #global options
> config_option1=setting1
> config_option2=setting2
> config_option3=setting3
> ...
> #dynamic section
> entry=dynamic entry number 1
>     option1=setting1
>     option2=setting2
>     option3=setting3
>
> entry=dynamic entry number 2
>     option1=setting1
>     option2=setting2
>     option3=setting3
>
> ....
>
> Is there a way i can dynamically create these entries in a single template?
>
> for instance a defined type:
>
> define application::configs (
>
>   $entry,
>
>   $option1
>
>   $option2
>
>   $option3
>
> ) {
>
> #not sure what I would put here
>
>  }
> Then pull those entries into the .erb with some kind of function?  Is this
> even possible to do?
>

And you then want to declare multiple application::config resources and
have them all show up in the resulting file, generated from a template?

It's not possible to have many-to-1 like that with the contents of a File
resource, although I myself have wished for something like that. Instead,
you can model your configs at a more finely-grained level than just a File
resource using other resources/modules, as Trey suggested, the
`concat::fragment` type in the puppetlabs/concat module, `ini_setting` type
in the puppetlabs/inifile module, or by using Augeas.

Wil

-- 
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/CAMmm3r6CyOVftRLo94W8VOGuUiPxaYbfgB8aGB5zOiF9w7qD-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to