diff --git a/gestion/gen_confs/dhcpd.py b/gestion/gen_confs/dhcpd.py index feadeca7..3977ad95 100755 --- a/gestion/gen_confs/dhcpd.py +++ b/gestion/gen_confs/dhcpd.py @@ -22,10 +22,10 @@ class dhcp(gen_config) : """ ######################################PARTIE DE CONFIGURATION # Fichier à écire - if hostname == 'rouge' : - DHCPD_CONF = '/etc/dhcp3/dhcpd.conf' - else : + if hostname == 'ragnarok' : DHCPD_CONF='/etc/dhcpd.conf' + else : + DHCPD_CONF = '/etc/dhcp3/dhcpd.conf' # Options générales if hostname == 'rouge' : @@ -52,16 +52,16 @@ option option-119 code 119 = text ; #""" else : base_conf = '' - + # Réseaux servis avec leurs options spécifiques - if hostname == 'zamok': - reseaux = { '138.231.136.0/21' : -"""option routers 138.231.136.4; - option domain-name-servers 138.231.136.3, 138.231.136.9, 138.231.136.10; - option domain-name "crans.org"; - option option-119 "crans.org wifi.crans.org";""" } - elif hostname == 'ragnarok': - reseaux = { '138.231.144.0/21' : +# if hostname == 'zamok': +# reseaux = { '138.231.136.0/21' : +#"""option routers 138.231.136.4; +# option domain-name-servers 138.231.136.3, 138.231.136.9, 138.231.136.10; +# option domain-name "crans.org"; +# option option-119 "crans.org wifi.crans.org";""" } + if hostname == 'ragnarok': + reseaux = { '138.231.144.0/21' : """option routers 138.231.148.1; option domain-name-servers 138.231.148.1; option domain-name "crans.org"; @@ -74,6 +74,11 @@ option option-119 code 119 = text ; option domain-name-servers 138.231.136.3, 138.231.136.9, 138.231.136.10; option domain-name "crans.org"; option option-119 "crans.org wifi.crans.org";""" } + elif hostname == 'titanic': + reseaux = {'10.2.9.0/24' : +"""authoritative; + option routers 10.2.9.1; + option domain-name-servers 10.2.9.1;""" # Options communes à toutes les réseaux servis base_dhcp=""" @@ -129,11 +134,11 @@ subnet %(network)s netmask %(netmask)s { # Si =0 ralera seulement si réseau vide verbose = 1 - if hostname == 'zamok': - restart_cmd = '/etc/init.d/dhcp restart' - elif hostname == 'ragnarok': +# if hostname == 'zamok': +# restart_cmd = '/etc/init.d/dhcp restart' + if hostname == 'ragnarok': restart_cmd = 'kill $(ps auxwwc | awk \'($11 == "dhcpd") {print $2}\') ; sleep 1 ; dhcpd $(grep -v \'^#\' /etc/dhcpd.interfaces | tr \'\\n\' \' \')' - elif hostname == 'rouge' : + elif hostname in ['rouge', 'titanic'] : restart_cmd = '/etc/init.d/dhcp3-server restart' else: restart_cmd = 'true' diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index ee00e6f0..5ffad4d2 100755 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -293,6 +293,11 @@ class vert(base_reconfigure): from adherents import mail_bienvenue self._do(mail_bienvenue(mails)) +class titanic(base_reconfigure): + def dhcp(self): + from gen_confs.dhcpd import dhcp + self._do(dhcp(), self._machines()) + signal.signal(signal.SIGINT, signal.SIG_DFL) # Comportement normal de Ctrl-C remove_lock('auto_generate')