From b7e9acf9f15f3bacbc67f18bd79403dd780e4206 Mon Sep 17 00:00:00 2001 From: becue Date: Thu, 2 Aug 2012 18:04:24 +0200 Subject: [PATCH] [Mails] Bye bye rouge Ignore-this: 41f78b2bd4df9b4411c032a4169574be darcs-hash:20120802160424-ab199-b3db7d18ed58b1e64d8dba4ee919e6870f4457a8.gz --- adm/analyse_upload | 3 +++ adm/aptitude.sh | 3 +++ gestion/gen_confs/adherents.py | 2 +- gestion/gen_confs/bind.py | 6 +++--- gestion/gen_confs/dhcpd.py | 5 ----- gestion/gen_confs/firewall_new.py | 10 +++++----- gestion/gen_confs/generate.py | 32 ++++++++++++++----------------- munin/scripts/hosts_plugins.py | 5 ++--- secours/secours.py | 6 ++---- surveillance/dhcp-detect.py | 2 +- tv/gen_dns.ml | 6 ++---- tv/gen_dns.pl | 6 ++---- tv/gen_dns.sh | 6 ++---- 13 files changed, 40 insertions(+), 52 deletions(-) diff --git a/adm/analyse_upload b/adm/analyse_upload index 023bdfc2..5453b408 100644 --- a/adm/analyse_upload +++ b/adm/analyse_upload @@ -1,5 +1,8 @@ #! /bin/sh +echo "Ce script ne doit plus être utilisé." +exit 1 + if [[ `hostname` != rouge ]] ; then echo "L'analyse des logs d'upload doit se faire sur rouge" exit 1 diff --git a/adm/aptitude.sh b/adm/aptitude.sh index 6bb9350e..d6bf9873 100644 --- a/adm/aptitude.sh +++ b/adm/aptitude.sh @@ -1,5 +1,8 @@ #! /bin/sh +echo "Ce script ne doit plus être utilisé." +exit 1 + if [[ $1 = "--help" || $1 = "-h" ]] then echo "Ce script permet de mettre à jour simplement les serveurs du crans. diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index ff050f3f..c4ddd225 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -86,7 +86,7 @@ class del_user: def reconfigure(self): if hostname == "fx": self.delete_fx() - elif hostname == "rouge": + elif hostname == "owl": self.delete_directory(u"Suppression des fichiers index de dovecot", "/var/dovecot-indexes/%s") elif hostname == "zamok": diff --git a/gestion/gen_confs/bind.py b/gestion/gen_confs/bind.py index a2b96496..54692434 100644 --- a/gestion/gen_confs/bind.py +++ b/gestion/gen_confs/bind.py @@ -68,18 +68,18 @@ la base LDAP } ### Liste DNS # Le premier doit être le maitre - DNSs = ['sable.crans.org', 'charybde.crans.org', 'freebox.crans.org', 'ovh.crans.org', 'rouge.crans.org' ] + DNSs = ['sable.crans.org', 'charybde.crans.org', 'freebox.crans.org', 'ovh.crans.org'] DNSs_private = ['vert.adm.crans.org'] ip_master_DNS = "10.231.136.9" ### Liste des délégations de zone # Pour les demandes de ces zones, le DNS dira d'aller voir les serveurs listés ici # Pour les noms des serveurs on met l'IP sans point ou le nom avec un point - DELEG = { 'tv.crans.org' : ['rouge.crans.org.' , 'charybde.crans.org.' , 'freebox.crans.org.', 'sable.crans.org.' , 'mdr.crans.org.'] } + DELEG = { 'tv.crans.org' : ['charybde.crans.org.' , 'freebox.crans.org.', 'sable.crans.org.' , 'mdr.crans.org.'] } ### Serveurs de mail # format : [ priorité serveur , .... ] - MXs = ['10 rouge.crans.org', '11 redisdead.crans.org', '20 ovh.crans.org', '20 freebox.crans.org'] + MXs = ['10 redisdead.crans.org', '20 ovh.crans.org', '20 freebox.crans.org'] SRVs = ['_jabber._tcp.crans.org. 86400 IN SRV 5 0 5269 xmpp.crans.org.', '_xmpp-server._tcp.crans.org. 86400 IN SRV 5 0 5269 xmpp.crans.org.', '_xmpp-client._tcp.crans.org. 86400 IN SRV 5 0 5222 xmpp.crans.org.'] diff --git a/gestion/gen_confs/dhcpd.py b/gestion/gen_confs/dhcpd.py index 31b29995..6895c9f9 100644 --- a/gestion/gen_confs/dhcpd.py +++ b/gestion/gen_confs/dhcpd.py @@ -27,11 +27,6 @@ class dhcp(gen_config) : else : DHCPD_CONF = '/etc/dhcp3/dhcpd.conf' - # Options générales - if hostname == 'rouge' : - base_conf = """option option-252 code 252 = text ; -option option-119 code 119 = text ; -""" # Hotspot ENS plus utilisé... # elif hostname == 'ragnarok' : # On rajoute les IP dynamiques diff --git a/gestion/gen_confs/firewall_new.py b/gestion/gen_confs/firewall_new.py index 99b59c7d..c5e48cda 100755 --- a/gestion/gen_confs/firewall_new.py +++ b/gestion/gen_confs/firewall_new.py @@ -1275,7 +1275,7 @@ class firewall_zamok(firewall_crans) : Rouge """ -class firewall_rouge(firewall_crans) : +class firewall_redisdead(firewall_crans) : """ Structure du firewall : table filter : @@ -1288,7 +1288,7 @@ class firewall_rouge(firewall_crans) : # interfaces physiques eth_pub = "eth0" - eth_adm = "eth0.2" + eth_adm = "eth1" def filter_table(self) : self.anim = anim('\tStructure de la table filter') @@ -1302,7 +1302,7 @@ class firewall_rouge(firewall_crans) : print OK def filter_table_tweaks(self) : - self.anim = anim('\tRègles spécifiques à rouge') + self.anim = anim('\tRègles spécifiques à redisdead') iptables("-P INPUT ACCEPT") iptables("-P FORWARD DROP") print OK @@ -1348,7 +1348,7 @@ class firewall_vert(firewall_crans) : iptables("-P FORWARD DROP") print OK -class firewall_sable(firewall_rouge): +class firewall_sable(firewall_redisdead): """Comme pour rouge, avec le proxy transparent en plus""" def mangle_table(self): @@ -1363,7 +1363,7 @@ class firewall_sable(firewall_rouge): def nat_table(self): - firewall_rouge.nat_table(self) + firewall_redisdead.nat_table(self) # Proxy transparent pour le filiaire iptables("-t nat -I PREROUTING -i eth0.2 -m mark --mark %s -j ACCEPT" % conf_fw.mark['proxy']) diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index a012bf10..52b1022a 100644 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -40,7 +40,7 @@ make_lock('auto_generate', 'Big lock', nowait=1) class base_reconfigure: __service_develop = { - 'macip': [ 'rouge-macip', 'zamok-macip', 'sable-macip', 'komaz-macip', 'gordon-macip', + 'macip': [ 'redisdead-macip', 'zamok-macip', 'sable-macip', 'komaz-macip', 'gordon-macip', 'sable-blacklist_check' ], # 'droits': [ 'rouge-droits', 'ragnarok-droits' ], 'blacklist_upload': [ 'sable-blacklist_upload', 'komaz-blacklist', 'zamok-blacklist' ], @@ -48,7 +48,7 @@ class base_reconfigure: 'blacklist_autodisc_upload': [ 'sable-blacklist_autodisc_upload', 'komaz-blacklist', 'zamok-blacklist'], 'blacklist_autodisc_p2p': [ 'sable-blacklist_autodisc_p2p', 'komaz-blacklist', 'zamok-blacklist'], 'blacklist_bloq': [ 'komaz-blacklist', 'sable-blacklist_bloq', 'zamok-blacklist', 'dns' ], - 'del_user': [ 'fx-del_user', 'rouge-del_user', 'zamok-del_user' ] + 'del_user': [ 'fx-del_user', 'owl-del_user', 'zamok-del_user' ] } def __init__(self, to_do=None): @@ -149,15 +149,9 @@ class redisdead(base_reconfigure): from adherents import ML_ens self._do(ML_ens(mails)) - -class rouge(base_reconfigure): - def autostatus(self): - from autostatus import autostatus - self._do(autostatus()) - -# def dhcp(self): -# from gen_confs.dhcpd import dhcp -# self._do(dhcp(), self._machines()) + def mail_ajout_droits(self, args): + from adherents import mail_ajout_droits + self._do(mail_ajout_droits(args)) def mail_modif(self, trucs): """ @@ -171,19 +165,21 @@ class rouge(base_reconfigure): from gen_confs.supervison import mail_solde self._do(mail_solde(modifs)) - def switch(self, chambres): - from gen_confs.switchs import switch - self._do(switch(chambres)) +class rouge(base_reconfigure): + def autostatus(self): + from autostatus import autostatus + self._do(autostatus()) +# def dhcp(self): +# from gen_confs.dhcpd import dhcp +# self._do(dhcp(), self._machines()) + +class owl(base_reconfigure): def del_user(self, args): # Suppression des fichiers index de dovecot from adherents import del_user self._do(del_user(args)) - def mail_ajout_droits(self, args): - from adherents import mail_ajout_droits - self._do(mail_ajout_droits(args)) - class pgsql(base_reconfigure): def surveillance_exemptions(self): from gen_confs.surveillance import exemptions diff --git a/munin/scripts/hosts_plugins.py b/munin/scripts/hosts_plugins.py index d96289e6..e0340e88 100755 --- a/munin/scripts/hosts_plugins.py +++ b/munin/scripts/hosts_plugins.py @@ -27,7 +27,7 @@ cron_plugins = { } # Hôtes pour lesquels le firewall est muninisé -munin_fw = sorted(["zamok", "rouge", "komaz", "sable", "gordon"]) +munin_fw = sorted(["zamok", "redisdead", "komaz", "sable", "gordon"]) hosts_plugins = { "zamok": { @@ -42,8 +42,7 @@ hosts_plugins = { "slapd_bdb_cache_pages": "slapd_bdb_cache_", "slapd_bdb_cache_percent": "slapd_bdb_cache_", }, - "rouge": { - "amavis": "amavis", + "redisdead": { "machines": "machines", # "webalizer_dixans": "webalizer_", # "webalizer_install-party": "webalizer_", diff --git a/secours/secours.py b/secours/secours.py index ceeb7b47..4cd7bcc9 100644 --- a/secours/secours.py +++ b/secours/secours.py @@ -31,8 +31,7 @@ ETAT_MAITRE = os.path.join(SECOURS_PATH, "etat_maitre") ### Fichiers à modifier, chaine indiquant un commentaire dans ceux-ci ### et commandes à excécuter après édition FICHIERS = { - 'rouge': { - '/etc/bind/named.conf.options': '//', + 'redisdead': { '/etc/postfix/main.cf': '#', }, 'sable': { @@ -51,9 +50,8 @@ FICHIERS = { }.get(HOSTNAME, {}) COMMANDES = { - 'rouge': [ + 'redisdead': [ '/etc/init.d/postfix restart', - '/etc/init.d/bind9 reload', ], 'sable': [ '/etc/init.d/squid3 reload', diff --git a/surveillance/dhcp-detect.py b/surveillance/dhcp-detect.py index 880c7a7f..e85762e9 100644 --- a/surveillance/dhcp-detect.py +++ b/surveillance/dhcp-detect.py @@ -113,7 +113,7 @@ def recoit(paquet): # On affiche print "Réception de : ", paquet.summary() # On verifie que c'est bien ce qu'on attend - if paquet.getlayer(Ether).dst.upper() == globals()['mac'] and paquet.haslayer(BOOTP) and paquet.getlayer(BOOTP).op == 2 and paquet.getlayer(IP).src != '138.231.136.3': + if paquet.getlayer(Ether).dst.upper() == globals()['mac'] and paquet.haslayer(BOOTP) and paquet.getlayer(BOOTP).op == 2 and paquet.getlayer(IP).src != '138.231.136.39': # DHCP pirate ? msg = "DHCP pirate ? (%s)" % paquet.getlayer(Ether).src print msg diff --git a/tv/gen_dns.ml b/tv/gen_dns.ml index 45e5fcd8..5d335e04 100644 --- a/tv/gen_dns.ml +++ b/tv/gen_dns.ml @@ -24,8 +24,7 @@ $TTL 86400 ) @ IN NS mdr.crans.org. -@ IN NS rouge.crans.org. -@ IN NS sila.crans.org. +@ IN NS charybde.crans.org. @ IN NS freebox.crans.org. @ IN A 138.231.136.243 @@ -44,8 +43,7 @@ $TTL 86400 ) @ IN NS mdr.crans.org. -@ IN NS rouge.crans.org. -@ IN NS sila.crans.org. +@ IN NS charybde.crans.org. @ IN NS freebox.crans.org. "; diff --git a/tv/gen_dns.pl b/tv/gen_dns.pl index aa5b6432..ae27a6d2 100755 --- a/tv/gen_dns.pl +++ b/tv/gen_dns.pl @@ -39,8 +39,7 @@ $serial ; numero de serie ) @ IN NS mdr.crans.org. -@ IN NS rouge.crans.org. -@ IN NS sila.crans.org. +@ IN NS charybde.crans.org. @ IN NS freebox.crans.org. @ IN A 138.231.136.243 @@ -58,8 +57,7 @@ $serial ; numero de serie ) @\tIN\tNS mdr.crans.org. -@\tIN\tNS rouge.crans.org. -@\tIN\tNS sila.crans.org. +@\tIN\tNS charybde.crans.org. @\tIN\tNS freebox.crans.org. "; diff --git a/tv/gen_dns.sh b/tv/gen_dns.sh index 58da6ad8..6f20527a 100644 --- a/tv/gen_dns.sh +++ b/tv/gen_dns.sh @@ -18,8 +18,7 @@ $(date +%s) ; numero de serie ; DNS de la zone par ordre de priorité @ IN NS mdr.crans.org. -@ IN NS rouge.crans.org. -@ IN NS sila.crans.org. +@ IN NS charybde.crans.org. @ IN NS freebox.crans.org. @ IN A 138.231.136.243 @@ -41,8 +40,7 @@ $(date +%s) ; numero de serie ; DNS de la zone par ordre de priorité @ IN NS mdr.crans.org. -@ IN NS rouge.crans.org. -@ IN NS sila.crans.org. +@ IN NS charybde.crans.org. @ IN NS freebox.crans.org. EOF