#!/bin/bash
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Usage: upload node-{1,2,3}
# it will upload the python libraries to
-# $prefix/lib/python2.4/site-packages/ganeti and the command line utils to
+# $prefix/lib/python2.X/dist-packages/ganeti and the command line utils to
# $prefix/sbin. It needs passwordless root login to the nodes.
-set -e
+set -e -u
usage() {
echo "Usage: $0 [--no-restart] [--no-cron] [--no-debug] hosts..." >&2
# fixed; we can read the prefix vars/etc.
PREFIX="$(echo @PREFIX@ | $SED)"
SYSCONFDIR="$(echo @SYSCONFDIR@ | $SED)"
+LIBDIR="$(echo @LIBDIR@ | $SED)"
PKGLIBDIR="$(echo @PKGLIBDIR@ | $SED)"
# copy additional needed files
install -D --mode=0755 doc/examples/ganeti.initd \
"$TXD/$SYSCONFDIR/init.d/ganeti"
+[ -f doc/examples/ganeti.logrotate ] && \
+install -D --mode=0755 doc/examples/ganeti.logrotate \
+ "$TXD/$SYSCONFDIR/logrotate.d/ganeti"
+
+[ -f doc/examples/ganeti-master-role.ocf ] && \
+install -D --mode=0755 doc/examples/ganeti-master-role.ocf \
+ "$TXD/$LIBDIR/ocf/resource.d/ganeti/ganeti-master-role"
+
+[ -f doc/examples/ganeti-node-role.ocf ] && \
+install -D --mode=0755 doc/examples/ganeti-node-role.ocf \
+ "$TXD/$LIBDIR/ocf/resource.d/ganeti/ganeti-node-role"
+
[ -f doc/examples/ganeti.default-debug -a -z "$NO_DEBUG" ] && \
install -D --mode=0644 doc/examples/ganeti.default-debug \
"$TXD/$SYSCONFDIR/default/ganeti"
# and now put it under $prefix on the target node(s)
for host; do
echo Uploading code to ${host}...
- rsync -v -rlDc \
+ rsync -v -rlKDc \
-e "ssh -oBatchMode=yes" \
--exclude="*.py[oc]" --exclude="*.pdf" --exclude="*.html" \
"$TXD/" \