diff --git a/Python/etc/sysctl.conf b/Python/etc/sysctl.conf new file mode 100644 index 0000000..ac0e415 --- /dev/null +++ b/Python/etc/sysctl.conf @@ -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"]