Facts + hiera is the short answer.

If different IP ranges means different zones or sites, just create a custom
fact that returns the zone/site name. Setup the zone/site hierarchically in
hiera and set the data there. Setup a higher level with the hostame in
hiera and put the exceptions there.

Regards
El 13/03/2014 19:28, "puppetstan" <stanislas.lev...@gmail.com> escribió:

> Hi
>
> Thanks for your answer.
>
> You say This kind of code is screaming, but what is your solution when you
> have a lot of server and the only solution is to locate with the IP
> address
>
> your prefer :
>
> node1
> node2
> ...
> node 200
> ...
> ??
>
> regards
>
>
> Le mercredi 12 mars 2014 19:02:06 UTC+1, Jose Luis Ledesma a écrit :
>>
>> Hi,
>>
>>   This kind of code is screaming for hiera!
>>
>> But if you want to continue this way, just set another if
>> if $::ipaddress =~ /^172.17.3.4/ <http://172.17.0.3/> {
>>    Data here
>> } elsif  $::ipaddress =~ /^172.17.3./ <http://172.17.0.3/> {
>>     Another data here
>> }
>>  El 12/03/2014 17:40, "puppetstan" <stanisla...@gmail.com> escribió:
>>
>>> Hello
>>>
>>> I have define in my server.pp file diferent zone and I defined my dns 
>>> servers
>>> (resolv_servers). for my /etc/resolv.conf for this zone
>>>
>>>
>>> #Zone 1
>>>         if $::ipaddress =~ /^172.17.3./ {
>>>         $ntp_heure = "ntp.domain.fr"
>>>         $fusioninventory_proxy = "http://proxy.domain.fr:8080";
>>>         $resolv_servers = [ '172.30.12.11', '172.30.12.2' ]
>>>         $resolv_search = "domain.fr"
>>>         $yumconf_proxy = "http://proxy.domain.fr:8080";
>>>         $yumconf_exclude = "kernel*"
>>>         include base::minimal
>>>         }
>>>
>>> The problem is that in this zone one server (172.17.3.4) that does not have
>>> the same dns. Is it possible to make an exclusion on this server and specify
>>> other addresses ips in this config file?
>>>
>>> thank you in advance
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/puppet-users/dc908091-8fbe-4e46-a5bb-4e1d1b2e503c%
>>> 40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/dc908091-8fbe-4e46-a5bb-4e1d1b2e503c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/d79e3ecf-b10b-41e6-b1f3-71a73356f83d%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/d79e3ecf-b10b-41e6-b1f3-71a73356f83d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAF_B3deBOkH_sfBUMFB_6QR7Ezw-sCu-Fj9Psfp8e1c%2Bkpw42Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to