Don wrote:
>> My own ntp module[1] only knows two kinds of ntp hosts: servers and
>> clients. The former connect to each other and external sources, while
>> the latter only connect to the local servers. The distinction is easily
>> done: those nodes which have set $ntp_servers are those which connect to
>> these external servers and thus _are_ servers. All others are clients.
> I did this too initially- but I consider NTP an "enterprise" service
> and was
> going to put it in /services/ but then I would end up with two NTP
> modules-
> one for NTP servers in /services and one for NTP clients. That seems
> really
> hackish.
> 
>> You can include classes that inherit from classes that are already
>> included and this will "patch up" the resources. The following is legal
>> and will result in a disabled openssh service on the node "strange":
>>
>> class openssh {
>>         service { openssh: ensure => running, enable => true }
>>         class disabled inherits openssh {
>>                 Service[openssh] { ensure => stopped, enable => false }
>>         }
>> }
>>
>> node fine {
>>         include openssh
>> }
>>
>> node strange inherits fine {
>>         include openssh::disabled
>> }
> I understand how this would work for a service like ssh- but what
> about in the case of something
> like NTP? In that case I would have:
> 
> class ntp {
>     file { "/etc/ntp.conf":
>         source  => "puppet:///ntp/ntpclient.conf",
>         require => Package["ntp"]
>     }
> }
> 
> class s_ntp {                           # in /services
>     file { "/etc/ntp.conf":
>         source  => "puppet:///s_ntp/ntpserver.conf",
>         require => Package["ntp"]
>     }
> }
> 
> node basenode {
>     include ntp
> }
> 
> node xyz inherits basenode {
> }
> 
> Now if I do this for my NTP master:
> 
> node ntpmaster inherits basenode {
>     include s_ntp
> }
> 
> I'm going to have two NTP files. Is there a way to excude the earlier
> definition of NTP so I'm not trying to have it update the same file
> twice?

No, you need to use inheritance.

> Is there a more sensible way of doing this that I'm not thinking of?
> 
> Should I just avoid /services because I clearly don't understand what
> it's
> for?

I would say that everything concerning NTP should go into one module. 
Perhaps the PuppetBEstPractices document needs a bit refactoring there.


Regards, DavidS

--~--~---------~--~----~------------~-------~--~----~
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