diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-09-08 13:00:56 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-09-08 13:00:56 -0300 |
commit | 1bad9e5728b59ef4fdd520552408b58701668c78 (patch) | |
tree | fd9d7e3bdf488d9ab9ff279030a00259e564f5a9 | |
parent | f94e41fecf2fea56fa65d1b57757e070569848c5 (diff) | |
download | kvmx-1bad9e5728b59ef4fdd520552408b58701668c78.tar.gz kvmx-1bad9e5728b59ef4fdd520552408b58701668c78.tar.bz2 |
Always sync default provisioners
-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..." |