Hi Martin, 

Thanks for the help. I used the second approach. 

1) I’ve created custom fact to identify the server location (I’m using the 
timezone fact) – Now I’m able to identify all my servers by location. 
2) I’m not sure about the second part “put ntp::servers into the 
appropriate hiera data hierarchy” – I’m using Foreman and NOT Puppet 
enterprise if it matters. Can you elaborate more how to implement it right, 
maybe add some code if possible.

Thanks,
EddieM

On Sunday, August 9, 2015 at 5:35:07 PM UTC+3, Martin Alfke wrote:
>
> Hi Eddie, 
>
> On 09 Aug 2015, at 16:25, Eddie Mashayev <eddi...@gmail.com <javascript:>> 
> wrote: 
>
> > Hi All, 
> > 
> > I have many servers spread in 3 different time zones USA (NY and San 
> Francisco) and also in ISR. Have 3 NTP servers, one NTP server in each 
> location. 
> > https://forge.puppetlabs.com/puppetlabs/ntp module is letting you to 
> insert an array of NTP servers 
> > 
> > class { '::ntp': 
> > servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], 
> > } 
> > 
> > I can override this array but the problem is how to fit the correct NTP 
> server to each server in the different location. 
> > In other words, how can I modified the puppet module to fit server to 
> the correct NTP Server by locations. 
> > 
> > For example - I thought using the server prefix name to choose the right 
> NTP server, for example if this server is located in NY so it prefix name 
> is ny-{server name} so I can fit it to NY NTP server but it look like a 
> headache to do it. 
> > 
> > Do you have any idea how can it be done in most efficient way with the 
> NTP module provided by puppetlabs. 
>
> Several solutions: 
>
> 1. write wrapper module per data center: 
>
> class ny_ntp { 
>   class { ‘::ntp’: 
>     server => [‘ny_ntp.corp.com’], 
>   } 
> } 
>
> class sf_ntp { 
>   class { ‘::ntp’: 
>     servers => [‘sf_ntp.corp.com’], 
>   } 
> } 
>
> class isr_ntp { 
>   class { ‘::ntp’: 
>    servers => [‘isr_ntp.corp.com’], 
>   } 
> } 
>
> use one of the the wrapper class within node classification 
>
> 2. use hiera 
>
> provide a custom fact to identify location per server and put ntp::servers 
> into the appropriate hiera data hierarchy. 
>
> Best, 
> Martin 
>
>
> > 
> > 
> > Thanks, 
> > EddieM 
> > 
> > -- 
> > 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...@googlegroups.com <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/8cdf1ae0-46c8-4de6-bb06-9f42bdbd31ed%40googlegroups.com.
>  
>
> > 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7398ad5-9b31-42e5-b3ee-d1eb889a8356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to