diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-09 23:14:56 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-09 23:14:56 -0300 |
commit | 824a5b9e0a4651669762d5150e58ac53eeee85ab (patch) | |
tree | dabe04418f62ab6acb4b9538fb448803a5672d2f | |
parent | 4d091d8c27c4787ff95978bb09543a885c8544e4 (diff) | |
download | kvmx-824a5b9e0a4651669762d5150e58ac53eeee85ab.tar.gz kvmx-824a5b9e0a4651669762d5150e58ac53eeee85ab.tar.bz2 |
Implements simple provisioning
-rwxr-xr-x | kvmx | 13 | ||||
-rw-r--r-- | kvmxfile | 8 |
2 files changed, 15 insertions, 6 deletions
@@ -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 @@ -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. |