[gen_conf/dhcpd] on supprime zamok, on rajoute titanic
darcs-hash:20090225185336-bd074-8359a0bb362020e707bdd5c4fae55911a7b66e89.gz
This commit is contained in:
parent
dd6fb093d6
commit
7f56d6f331
2 changed files with 26 additions and 16 deletions
|
@ -22,10 +22,10 @@ class dhcp(gen_config) :
|
||||||
"""
|
"""
|
||||||
######################################PARTIE DE CONFIGURATION
|
######################################PARTIE DE CONFIGURATION
|
||||||
# Fichier à écire
|
# Fichier à écire
|
||||||
if hostname == 'rouge' :
|
if hostname == 'ragnarok' :
|
||||||
DHCPD_CONF = '/etc/dhcp3/dhcpd.conf'
|
|
||||||
else :
|
|
||||||
DHCPD_CONF='/etc/dhcpd.conf'
|
DHCPD_CONF='/etc/dhcpd.conf'
|
||||||
|
else :
|
||||||
|
DHCPD_CONF = '/etc/dhcp3/dhcpd.conf'
|
||||||
|
|
||||||
# Options générales
|
# Options générales
|
||||||
if hostname == 'rouge' :
|
if hostname == 'rouge' :
|
||||||
|
@ -52,16 +52,16 @@ option option-119 code 119 = text ;
|
||||||
#"""
|
#"""
|
||||||
else :
|
else :
|
||||||
base_conf = ''
|
base_conf = ''
|
||||||
|
|
||||||
# Réseaux servis avec leurs options spécifiques
|
# Réseaux servis avec leurs options spécifiques
|
||||||
if hostname == 'zamok':
|
# if hostname == 'zamok':
|
||||||
reseaux = { '138.231.136.0/21' :
|
# reseaux = { '138.231.136.0/21' :
|
||||||
"""option routers 138.231.136.4;
|
#"""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-servers 138.231.136.3, 138.231.136.9, 138.231.136.10;
|
||||||
option domain-name "crans.org";
|
# option domain-name "crans.org";
|
||||||
option option-119 "crans.org wifi.crans.org";""" }
|
# option option-119 "crans.org wifi.crans.org";""" }
|
||||||
elif hostname == 'ragnarok':
|
if hostname == 'ragnarok':
|
||||||
reseaux = { '138.231.144.0/21' :
|
reseaux = { '138.231.144.0/21' :
|
||||||
"""option routers 138.231.148.1;
|
"""option routers 138.231.148.1;
|
||||||
option domain-name-servers 138.231.148.1;
|
option domain-name-servers 138.231.148.1;
|
||||||
option domain-name "crans.org";
|
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-servers 138.231.136.3, 138.231.136.9, 138.231.136.10;
|
||||||
option domain-name "crans.org";
|
option domain-name "crans.org";
|
||||||
option option-119 "crans.org wifi.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
|
# Options communes à toutes les réseaux servis
|
||||||
base_dhcp="""
|
base_dhcp="""
|
||||||
|
@ -129,11 +134,11 @@ subnet %(network)s netmask %(netmask)s {
|
||||||
# Si =0 ralera seulement si réseau vide
|
# Si =0 ralera seulement si réseau vide
|
||||||
verbose = 1
|
verbose = 1
|
||||||
|
|
||||||
if hostname == 'zamok':
|
# if hostname == 'zamok':
|
||||||
restart_cmd = '/etc/init.d/dhcp restart'
|
# restart_cmd = '/etc/init.d/dhcp restart'
|
||||||
elif 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 == 'rouge' :
|
elif hostname in ['rouge', 'titanic'] :
|
||||||
restart_cmd = '/etc/init.d/dhcp3-server restart'
|
restart_cmd = '/etc/init.d/dhcp3-server restart'
|
||||||
else:
|
else:
|
||||||
restart_cmd = 'true'
|
restart_cmd = 'true'
|
||||||
|
|
|
@ -293,6 +293,11 @@ class vert(base_reconfigure):
|
||||||
from adherents import mail_bienvenue
|
from adherents import mail_bienvenue
|
||||||
self._do(mail_bienvenue(mails))
|
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
|
signal.signal(signal.SIGINT, signal.SIG_DFL) # Comportement normal de Ctrl-C
|
||||||
remove_lock('auto_generate')
|
remove_lock('auto_generate')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue