[backuppc] Factorisation, en vue d'avoir une conf modulaire.
This commit is contained in:
parent
0ad3877053
commit
ee3a587b66
5 changed files with 144 additions and 59 deletions
|
@ -1,3 +1,6 @@
|
|||
# -*- coding: utf-8; mode: python -*-
|
||||
|
||||
include("backups")
|
||||
|
||||
info["owner"] = "backuppc"
|
||||
info["group"] = "adm"
|
||||
|
@ -67,13 +70,5 @@ def backuppc_hosts(comment, hostslist):
|
|||
@#larson 1 bill # <--- example DHCP host entry
|
||||
@
|
||||
|
||||
backuppc_hosts("Backups des homes", ["adherentsak", "adherentslz"])
|
||||
# TODO: ci-dessous gérer cette liste via un groupe bcfg2
|
||||
backuppc_hosts("Backups des serveurs",
|
||||
["asterisk", "babar", "cas", "charybde", "dhcp", "irc",
|
||||
"kdell", "komaz", "nat64", "news", "niomniom",
|
||||
"o2",
|
||||
"owl", "radius", "redisdead", "routeur",
|
||||
"sable", "thot", "titanic", "tracker", "vert", "vo",
|
||||
"xmpp",
|
||||
"zamok", "zbee"])
|
||||
backuppc_hosts("Backups des homes", HomeHosts)
|
||||
backuppc_hosts("Backups des serveurs", RsyncHosts)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
include("secrets")
|
||||
include("ip")
|
||||
include("backups")
|
||||
|
||||
info["perms"] = 0644
|
||||
header("Fichier de configuration de rsync")
|
||||
|
@ -28,57 +29,16 @@ header("Fichier de configuration de rsync")
|
|||
@# verifie les droits de /etc/rsyncd.secrets
|
||||
@strict modes = yes
|
||||
@# personne n'accede aux modules par defaut
|
||||
@hosts deny = *
|
||||
@hosts deny = *
|
||||
@
|
||||
@# MODULE OPTIONS
|
||||
|
||||
# Liste des dossiers a sauvegarder par serveur, en plus de la racine.
|
||||
backup_folders = {
|
||||
'canard' : { 'usr' : '/usr',
|
||||
'var' : '/var' },
|
||||
|
||||
'egon' : { 'usr' : '/usr',
|
||||
'var' : '/var' },
|
||||
|
||||
'komaz' : { 'var' : '/var' },
|
||||
|
||||
'vo' : { 'var' : '/var' },
|
||||
|
||||
'news' : { 'news-spool' : '/var/spool/news',
|
||||
'news-lib' : '/var/lib/news' },
|
||||
|
||||
'sable' : { 'usr' : '/usr',
|
||||
'var' : '/var',
|
||||
'log-squid' : '/var/log/squid3' },
|
||||
|
||||
'charybde' : { 'slash' : '/',
|
||||
'usr' : '/usr',
|
||||
'var' : '/var',
|
||||
'installparty' : '/pubftp/pub/Install-party',
|
||||
'git' : '/pubftp/git' },
|
||||
|
||||
'vert' : { 'var' : '/var',
|
||||
'root' : '/root',
|
||||
},
|
||||
|
||||
'zamok' : { 'var' : '/var',
|
||||
'usr' : '/usr' },
|
||||
|
||||
'niomniom' : { 'www' : '/var/local' },
|
||||
|
||||
'owl': { 'dovecot': '/var/dovecot-indexes' },
|
||||
|
||||
'redisdead' : { 'var': '/var',
|
||||
'mailman': '/var/lib/mailman' },
|
||||
|
||||
'pgsql' : { 'postgresql': '/var/lib/postgresql' },
|
||||
|
||||
'zbee' : { 'adherentsak': '/home-adh',
|
||||
'adherentslz': '/home-adh'},
|
||||
}.get(hostname, {})
|
||||
|
||||
# On rajoute la racine pour tout le monde
|
||||
backup_folders["slash"] = "/"
|
||||
backup_folders = RsyncHostsToBackup[hostname]
|
||||
backup_folders.update(RsyncClassicalDirs)
|
||||
for excluded in RsyncHostsToExclude[hostname]:
|
||||
backup_folders.pop(excluded)
|
||||
|
||||
ip = admipof("babar")
|
||||
|
||||
|
@ -91,6 +51,3 @@ secrets file = /etc/crans/secrets/rsyncd.secrets
|
|||
hosts allow = babar.adm.crans.org %(ip)s""" % { 'name' : name,
|
||||
'path' : path,
|
||||
'ip' : ip }
|
||||
if (hostname, name) == ("vert", "root"):
|
||||
# Sauvegarde des mots de passe chiffres
|
||||
print "include = +*.asc -*"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue