Feed the array to a define where you call the template.

On Fri, Jul 25, 2014 at 3:08 AM, senorsmile <[email protected]> wrote:

> For example, I have an array like this:
>
> clusters => [
>   'cluster1',
>   'cluster2',
>   'cluster3',
>   'cluster4',
> ]
>
>
>
> I then have a cluster.init.erb that looks soemthing like this:
>
> start on runlevel [2345]
> stop on runlevel [!2345]
>
> expect fork
> respawn
>
> <% @clusters.each do | cluster | -%>
> env PIDFILE="/var/run/${cluster}.pid"
>
> exec /usr/sbin/program_name --pid-file=$PIDFILE
> <% end -%>
>
>
> That is all theoretical at this point since it doesn't work.
> What I need it to do is dynamically generate a certain number of files,
> equal to the number of files in the array "clusters", whose names I will
> not know beforehand, and changes from host to host.
>
>
>
>
>
>  --
> 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/8959bc99-9944-4676-ae0f-3c834e74cc37%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/8959bc99-9944-4676-ae0f-3c834e74cc37%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit 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/CAMo7R_fewzfeGZP3HvEnSu7kwKGgagqRdLKH5DThZrF9xwJkYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to