aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-09 23:14:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-09 23:14:56 -0300
commit824a5b9e0a4651669762d5150e58ac53eeee85ab (patch)
treedabe04418f62ab6acb4b9538fb448803a5672d2f
parent4d091d8c27c4787ff95978bb09543a885c8544e4 (diff)
downloadkvmx-824a5b9e0a4651669762d5150e58ac53eeee85ab.tar.gz
kvmx-824a5b9e0a4651669762d5150e58ac53eeee85ab.tar.bz2
Implements simple provisioning
-rwxr-xr-xkvmx13
-rw-r--r--kvmxfile8
2 files changed, 15 insertions, 6 deletions
diff --git a/kvmx b/kvmx
index 16ff3eb..9cec362 100755
--- a/kvmx
+++ b/kvmx
@@ -342,8 +342,17 @@ function kvmx_purge {
# Provision a machine
function kvmx_provision {
- echo "TODO: provision"
- exit 1
+ if ! kvmx_running; then
+ echo "$BASENAME: guest $VM is not running"
+ exit 1
+ fi
+
+ if [ -z "$provision_script" ]; then
+ echo "$BASENAME: error: parameter provision_script is not configured for $VM."
+ exit 1
+ fi
+
+ echo "sudo $provision_script" | kvmx_ssh
}
# Print guest image file name
diff --git a/kvmxfile b/kvmxfile
index 32d2600..d8394c8 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -5,12 +5,12 @@
# Which base box you should use. Leave unconfigured to use kvmx-create instead.
#basebox="stretch"
-# Absolute or relative path for a provision script.
-#provision_script="default"
-
# Set this is you want to be able to share folders between host and guest.
shared_folder="."
-shared_folder_mountpoint="/media/shared"
+shared_folder_mountpoint="/home/user/$VM"
+
+# Absolute path for a provision script located inside the guest.
+#provision_script="/home/user/$VM/provision"
# Set this if you want to automatically attach an spice client when the machine
# boots.