From 1d2f6fc34c412e9efd34c697ab8a9d0fdc1d3f59 Mon Sep 17 00:00:00 2001 From: Marc 'HE' Brockschmidt Date: Thu, 27 Dec 2007 17:17:13 +0100 Subject: [PATCH] Make the host ud-replicate syncs from configurable in userdir-ldap.conf, instead of hardcoding it into the script. Also introduce a variable containing a shell glob on which no remote sync is needed, so that the db host doesn't need to have a key in the authorized_keys file for the sshdist user --- debian/changelog | 11 +++++++++-- ud-replicate | 6 ++++-- userdir-ldap.conf | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 301da9a..67ec0e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,10 +18,17 @@ userdir-ldap (0.3.15+xxx) XXunstable; urgency=low ud-{user,group,role}add and abstract them out into userdir_ldap.py * ud-useradd: Avoid a TypeError exception when constructing the template filename - * Remove use of deprecated functions from the string module + * Remove use of deprecated functions from the string module * ud-arbimport: os.exit -> sys.exit - -- Mark Hymers Wed, 26 Dec 2007 20:54:28 +0000 + [ Marc 'HE' Brockschmidt ] + * Make the host ud-replicate syncs from configurable in userdir-ldap.conf, + instead of hardcoding it into the script. Also introduce a variable + containing a shell glob on which no remote sync is needed, so that + the db host doesn't need to have a key in the authorized_keys file + for the sshdist user + + -- Marc 'HE' Brockschmidt Thu, 27 Dec 2007 17:14:51 +0100 userdir-ldap (0.3.15) unstable; urgency=low diff --git a/ud-replicate b/ud-replicate index 1a0ca55..26818ed 100755 --- a/ud-replicate +++ b/ud-replicate @@ -31,17 +31,19 @@ fi PATH=/sbin:/usr/sbin:/bin:/usr/bin export PATH HOST=`hostname -f` +SYNCHOST=`ud-config synchost`; +LOCALSYNCON=`ud-config localsyncon`; cd /tmp/ cd /var/lib/misc || cd /var/state/glibc/ || cd /var/db/ lockfile -r 1 -l 3600 lock trap "rm -f lock" exit case $HOST in -*samosa*) +*$LOCALSYNCON*) udhost= ;; *) - udhost="sshdist@db:" + udhost="sshdist@$SYNCHOST:" ;; esac diff --git a/userdir-ldap.conf b/userdir-ldap.conf index 9094bd8..048e907 100644 --- a/userdir-ldap.conf +++ b/userdir-ldap.conf @@ -1,5 +1,11 @@ # Config file for ldap scripts +# ud-replicate client configuration: +# host from which to rsync the information (the one running ud-generate) +synchost = "db"; +# hosts on which to use a local path to get the data (used as a shell glob later) +localsyncon = "*samosa*"; + # Basic LDAP configuration ldaphost = "db.debian.org"; basedn = "ou=users,dc=debian,dc=org"; -- 2.20.1