From 1bad9e5728b59ef4fdd520552408b58701668c78 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 8 Sep 2017 13:00:56 -0300 Subject: Always sync default provisioners --- kvmx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/kvmx b/kvmx index 5720848..cee2c76 100755 --- a/kvmx +++ b/kvmx @@ -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..." -- cgit v1.2.3