]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Let provider hosts trigger updates
authorPeter Palfrader <peter@palfrader.org>
Sat, 8 Dec 2012 17:20:14 +0000 (18:20 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 8 Dec 2012 17:20:14 +0000 (18:20 +0100)
modules/roles/files/static-mirroring/static-master-ssh-wrap

index 2b2ddea7fdbb90825379844e7f7fe2e8ca9580d0..df7e7217bc6e876891d3731d7105f89da2a060fa 100755 (executable)
@@ -26,6 +26,7 @@ set -u
 
 MYLOGNAME="`basename "$0"`[$$]"
 BASEDIR="/home/staticsync/static-master"
+COMPONENTLIST=/etc/static-components.conf
 
 usage() {
        echo "local Usage: $0 <host>"
@@ -109,15 +110,16 @@ do_update_component() {
        component="$1"
        shift
 
-       #if [ "$component" = "www.torproject.org" ] && [ "$remote_host" = "vescum.torproject.org" ]; then
-       #       exec static-master-update-component "$component"
-       #       echo >&2 "Exec failed"
-       #       croak "exec failed"
-       #else
+       hit="$(awk -v component="$component" -v host="$remote_host" '$1 == component && $2 == host {print $3; exit}' "$COMPONENTLIST")"
+       if [ -n "$hit" ]; then
+               exec static-master-update-component "$component"
+               echo >&2 "Exec failed"
+               croak "exec failed"
+       else
                info "Not whitelisted: $remote_host update $component"
                echo >&2 "Not whitelisted: $remote_host update $component"
                exit 1
-       #fi
+       fi
 }