Puppet agent should pick DNS and NTP servers based on location
We have 3 different Datacenters in our infrastructure. I am using puppetlabs/ntp module and saz/resolvconf and using hierainclude('classes') to install these 2 modules to all agents added to puppet.
Now my common.yaml file looks like this :
--- classes: ['ntp', 'resolv_conf'] ntp::servers: - datacenter1 NTP server - datacenter2 NTP server - datacenter3 NTP server resolv_conf::nameservers: - datacenter1 DNS server - datacenter2 DNS server - datacenter3 DNS server
So my puppet agent in Datacenter 3 gets all 3 datacenters's NTP server and DNS server.
But i would like it to have just pick NTP server and DNS server based on its location.
Like if my puppet agent is in Datacenter 1 then, use NTP and DNS servers from Datacenter 1. How can i define that in my common.yaml ?