crans_bcfg2/Python/etc/fstab

28 lines
973 B
Python

# -*- coding: utf-8; mode: python -*-
header("Les modifications locales sont a placer dans le fichier /etc/fstab.local")
import string
def mnt(fs, mntpoint, type, options=[], dump=0, pass_=0):
print ("%s %s %s %s %d %d" %
(fs, mntpoint, type,
(options and ",".join(options)) or "defaults",
dump, pass_))
@# Les definitions classiques
mnt("proc", "/proc", "proc")
mnt("shm", "/dev/shm", "tmpfs")
@# Les definitions locales
print metadata.Probes["fstab_local"]
if has("nfs"):
@# Le nfs
mnt("nfs.adm.crans.org:/usr/scripts", "/usr/scripts", "nfs", ["rw"])
if has("home-permanent"):
# Pour ceux qui accedent beaucoup aux homes on monte tout le /home
mnt("nfs.adm.crans.org:/home-adh", "/home", "nfs", ["rw"]);
if has("o2"):
for partition in list(string.lowercase) + ['logs', 'mail']:
mnt("nfs.adm.crans.org:/home-adh/%s" % (partition,), "/home/%s" % (partition,), "nfs", ["rw"]);