Re: [Puppet Users] Any advise on this hiera stuff

2015-06-02 Thread Craig Dunn
On Mon, Jun 1, 2015 at 11:42 AM, Twan  wrote:
> Hiera:
> session_managers:
>   sm001.guest.lan:
>   - agent01.guest.lan
>   - agent02.guest.lan
>   sm02.guest.lan
>   - agent03.guest.lan
>   - agent04.guest.lan
>
>
> I need to get the following:
> On session managers a list (comman seperated) of the agents
> On each agent, the sessionmanager on a line in a configfile.
>

If Im understanding you correctly, then maybe join() from stdlib and
inline_template may help you

$agents=join($session_managers[$::fqdn], ',')

$manager=inline_template('<%= @session_managers.keys.select { |k|
@session_managers[k].include?(scope["::fqdn") }[0] %>')

 Or, something like that anyway :-)
Craig


-- 
Enviatics | Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACxdKhH6cjFM6GMbHNzDan30WpULE1UTWdHbm2MiGvVJRZxYag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Any advise on this hiera stuff

2015-06-01 Thread Twan
Hi,

I need to resolv the folowing but have no clue how to accomplish it, can 
any of you shine a light?

Hiera:
session_managers:
  sm001.guest.lan:
  - agent01.guest.lan
  - agent02.guest.lan
  sm02.guest.lan
  - agent03.guest.lan
  - agent04.guest.lan


I need to get the following:
On session managers a list (comman seperated) of the agents
On each agent, the sessionmanager on a line in a configfile.

Please some advise

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/337a10b4-380c-496b-9b4e-b145434d879a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.