[dhcp.py,generate.py] draft pour du dhcp sur sable
la classe dhcp_sable est encore incorrecte, car ldap_crans.all_machines ne renvoie pas les machines de 10.24/16. Il semble que de toute façon, c'est dans dhcp_new.py que ce sera codé darcs-hash:20090702060339-bd074-032ccd0ba85c36e9f799fd2fb370eeb3e8fdaaea.gz
This commit is contained in:
parent
ac80f43a4f
commit
b4acaeed00
2 changed files with 33 additions and 2 deletions
|
@ -50,6 +50,26 @@ option option-119 code 119 = text ;
|
||||||
# range dynamic-bootp 10.231.149.1 10.231.149.254;
|
# range dynamic-bootp 10.231.149.1 10.231.149.254;
|
||||||
# }
|
# }
|
||||||
#"""
|
#"""
|
||||||
|
|
||||||
|
elif hostname == 'sable':
|
||||||
|
# Options communes à toutes les réseaux servis
|
||||||
|
base_conf="""
|
||||||
|
# VLan accueil
|
||||||
|
subnet 10.51.0.0 netmask 255.255.0.0 {
|
||||||
|
range 10.51.0.10 10.51.255.200;
|
||||||
|
# On n'a besoin que du dns ici (pour le portail captif)
|
||||||
|
option domain-name-servers 10.51.0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# VLan isolement
|
||||||
|
subnet 10.52.0.0 netmask 255.255.0.0 {
|
||||||
|
range 10.52.0.10 10.52.255.200;
|
||||||
|
option domain-name-servers 10.52.0.1;
|
||||||
|
option routers 10.52.0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
else :
|
else :
|
||||||
base_conf = ''
|
base_conf = ''
|
||||||
|
|
||||||
|
@ -88,6 +108,13 @@ option option-119 code 119 = text ;
|
||||||
option routers 10.2.9.1;
|
option routers 10.2.9.1;
|
||||||
option domain-name-servers 10.2.9.1;""" }
|
option domain-name-servers 10.2.9.1;""" }
|
||||||
|
|
||||||
|
elif hostname == 'sable':
|
||||||
|
# le vlan gratuit
|
||||||
|
reseaux = {'10.42.0.0/16' :
|
||||||
|
"""authoritative;
|
||||||
|
option routers 10.42.0.1;
|
||||||
|
option domain-name-servers 10.42.0.1;""" }
|
||||||
|
|
||||||
# Options communes à toutes les réseaux servis
|
# Options communes à toutes les réseaux servis
|
||||||
base_dhcp="""
|
base_dhcp="""
|
||||||
subnet %(network)s netmask %(netmask)s {
|
subnet %(network)s netmask %(netmask)s {
|
||||||
|
@ -140,7 +167,7 @@ subnet %(network)s netmask %(netmask)s {
|
||||||
# restart_cmd = '/etc/init.d/dhcp restart'
|
# restart_cmd = '/etc/init.d/dhcp restart'
|
||||||
if hostname == 'ragnarok':
|
if hostname == 'ragnarok':
|
||||||
restart_cmd = 'kill $(ps auxwwc | awk \'($11 == "dhcpd") {print $2}\') ; sleep 1 ; dhcpd $(grep -v \'^#\' /etc/dhcpd.interfaces | tr \'\\n\' \' \')'
|
restart_cmd = 'kill $(ps auxwwc | awk \'($11 == "dhcpd") {print $2}\') ; sleep 1 ; dhcpd $(grep -v \'^#\' /etc/dhcpd.interfaces | tr \'\\n\' \' \')'
|
||||||
elif hostname in ['rouge', 'titanic'] :
|
elif hostname in ['rouge', 'titanic', 'sable'] :
|
||||||
restart_cmd = '/etc/init.d/dhcp3-server restart'
|
restart_cmd = '/etc/init.d/dhcp3-server restart'
|
||||||
else:
|
else:
|
||||||
restart_cmd = 'true'
|
restart_cmd = 'true'
|
||||||
|
|
|
@ -217,6 +217,10 @@ class komaz(base_reconfigure):
|
||||||
self.__fw().classes_p2p_maj(ips)
|
self.__fw().classes_p2p_maj(ips)
|
||||||
|
|
||||||
class sable(base_reconfigure):
|
class sable(base_reconfigure):
|
||||||
|
def dhcp(self):
|
||||||
|
from gen_confs.dhcpd_new import dhcp
|
||||||
|
self._do(dhcp(), self._machines())
|
||||||
|
|
||||||
def dns(self):
|
def dns(self):
|
||||||
from gen_confs.bind import dns
|
from gen_confs.bind import dns
|
||||||
self._do(dns(), self._machines())
|
self._do(dns(), self._machines())
|
||||||
|
@ -257,7 +261,7 @@ class sable(base_reconfigure):
|
||||||
from gen_confs.squid import squid_bloq
|
from gen_confs.squid import squid_bloq
|
||||||
self._do(squid_bloq())
|
self._do(squid_bloq())
|
||||||
|
|
||||||
sila = sable
|
# sila = sable
|
||||||
|
|
||||||
class ragnarok(base_reconfigure):
|
class ragnarok(base_reconfigure):
|
||||||
__restart_wifi_update = False
|
__restart_wifi_update = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue