On Tue, Jun 23, 2009 at 12:43 PM, Don<d...@blacksun.org> wrote:
>
>> This were template files com in really handy. Instead of having two
>> ntp .conf files you use one ntp_conf.erb that has a case switch.
> If I put a case statement in the .erb file then I've tied the template
> to a specific host or set of hosts. I'd rather pass in the variables
> to the template and keep the logic outside the template.

Here I am seeing a thought process barrier. You do not have to tye a
template case to _servers_ by name. The idea is to tye the template
case to _roles_. That way it does not matter what the server name is
or where it is. If it is defined as have having a ntp server role then
it gets that configuration. One of the strengths I have found in
templates is that you can but the logic in the template. Pass the
roles you want the server to play to the template , server , client,
or client and server and the template sorts itself out to produce the
correct config file to hand out. Also remeber anything you can do in
ruby you can pretty much do in the templates. You may also want to
look at the generate function. It lets you call external scripts to
produce results that will be used by puppet for things like source.


> This is sort of what I've done. I end up with a template file that
> accepts things like the master servers as an array, as well as the
> ACL's and so on. It populates just fine with the variables I specify.
> I specify a null set of ACL's for the clients, and different masters
> and such for the servers.

> In the end we come back to the same sort of problem though- It's not
> possible to override values, and so we define everything backwards.
> That, plus the scoping rules, makes it (to me at least) very difficult
> to build a nice clean organizational structure.

evan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to