[./Python/etc/sysctl.conf] Oubli (merci maman :) )

darcs-hash:20091230153426-8fbb1-bdd881ba6c8fc0e08d739e2bed29d6d17df8e762.gz
This commit is contained in:
Olivier Huber 2009-12-30 16:34:26 +01:00
parent d3cd1730e3
commit 51c1d20824

49
Python/etc/sysctl.conf Normal file
View file

@ -0,0 +1,49 @@
# -*- coding: utf-8; mode: python -*-
info["owner"] = "root"
info["group"] = "root"
info["perms"] = 0644
template_ra="""
net.ipv6.conf.%(If)s.autoconf = 0
net.ipv6.conf.%(If)s.accept_ra = 0
net.ipv6.conf.%(If)s.accept_ra_defrtr = 0
net.ipv6.conf.%(If)s.accept_ra_rtr_pref = 0
net.ipv6.conf.%(If)s.accept_ra_pinfo = 0
net.ipv6.conf.%(If)s.accept_source_route = 0
net.ipv6.conf.%(If)s.accept_redirects = 0
"""
header("""
Les modifications locales sont à mettre dans le fichier /etc/sysctl.local
Voir http://wiki.crans.org/CransTechnique/Bcfg2/... pour plus d'explications.
""")
# Définitions communes
print """
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.default.accept_ra_defrtr = 0
net.ipv6.conf.default.accept_ra_rtr_pref = 0
net.ipv6.conf.default.accept_ra_pinfo = 0
net.ipv6.conf.default.accept_source_route = 0
net.ipv6.conf.default.accept_redirects = 0
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.all.accept_ra_defrtr = 0
net.ipv6.conf.all.accept_ra_rtr_pref = 0
net.ipv6.conf.all.accept_ra_pinfo = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_redirects = 0
"""
Probe_Ifs = metadata.Probes["mac"].split('\n')
Ifs = [Probe_Ifs[i] for i in range(len(Probe_Ifs)) if i % 2 == 0]
# Un '.' supplémentaire dans une clé sysctl, c'est mal.
for i in Ifs:
print template_ra % { 'If' : i.replace('.','/') }
print metadata.Probes["sysctl"]