Hi, Daniel.

> So, we have these machine configurations:
>
>  NTP master: fetch from an upstream server, serve local subnet
>  NTP client: fetch from local server, serve no one
>
> We need, for each host, to configure it as either an NTP master or
> client, talking to the appropriate servers — and the upstream server
> varies based on location.

Have you considered using a custom fact to determine each server's  
location? All the fact would have to do is figure out which subnet a  
server is on and compare that to a list of subnets for each network.  
The value of the fact could be your name for the network. (E.g.,  
"fitzroy".)

If your custom fact was called "networkname", your manifests might  
look something like this:

> class ntp {
>   file { "/etc/ntp.conf":
>     source => [ "puppet:///ntp/ntp.conf.${hostname}", "puppet:///ntp/ 
> ntp.conf.${networkname}" ]
>   }
>   service { "ntp":
>     ensure => running,
>     enable => true,
>     subscribe => File["/etc/ntp.conf"]
>   }
> }

Each ntp master would have its own copy of ntp.conf, named  
ntp.conf.<master hostname>. Each client would use a copy of ntp.conf  
customized for the network it resides on, named ntp.conf.<network  
name>. (Giving a list of sources to the "source" parameter is like  
specifying a search path; the first source that exists will be used.)

This is much simpler than trying to declare which network every single  
host is on.

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

Reply via email to