diff options
-rwxr-xr-x | kvmx | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -873,14 +873,25 @@ function kvmx_provision { exit 1 fi + echo "Syncing provision files into the guest..." + + # Always sync default provisioners + SSH="`cat $SSHFILE`" + ORIG="$KVMX_BASE/share/provision/" + DEST="/usr/local/share/kvmx/provision/" + + echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh + rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/ + if [ ! -z "$provision_rsync" ]; then - SSH="`cat $SSHFILE`" ORIG="`echo $provision_rsync | cut -d ' ' -f 1`" DEST="`echo $provision_rsync | cut -d ' ' -f 2`" - echo "Syncing provision files into the guest..." - echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh - rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/ + # Sync custom provisioners + if [ "$ORIG" != "$KVMX_BASE/share/provision/" ] && [ "$DEST" != "/usr/local/share/kvmx/provision/" ]; then + echo "sudo mkdir -p `dirname $DEST`" | kvmx_ssh + rsync -av -e "$SSH_COMMAND -o Port=$SSH" $provision_rsync_opts --rsync-path "sudo rsync" $ORIG/ 127.0.0.1:$DEST/ + fi fi echo "Running provision command inside the guest..." |