Re: [Puppet Users] Template populated from multiple defines

Gabriel Filion
2012-05-07T16:09:42Z

On 12-05-04 07:23 PM, Jared Curtis wrote:
> I''m trying to create a file similar to this
> <Users "admin">
>   <user "user1">
>     Name User One
>     Phone 1112223333
>   </user>
>   <user "user2">
>     Name User Two
>   </user>
> </Users>
>
> I want to be able to add users in this fashion
> app::users {
>   ''user1'': name => ''User One'', phone
=> ''1112223333'';
>   ''user2'': name => ''User Two'';
> }
> Then use a template to create the actual file. I''ve done something
> similar to this in the past by using hashes but it seems like a hack and
> doesn''t cleanly express what variables are available to be set.
>
> Anyone have any suggestions on the best way to make this work?

The only way that I could think of doing this would be by using a
concatenated file[1]. Each define would create a morcel that would get
concatenated to the "main part" (rest of the structure) for the final
result.

https://github.com/ripienaar/puppet-concat

--
Gabriel Filion