summaryrefslogtreecommitdiff
path: root/remove-vm
diff options
context:
space:
mode:
authoransible <ansible@exolobe2>2015-10-08 21:16:19 +0300
committeransible <ansible@exolobe2>2015-10-08 21:16:19 +0300
commit0505986743df1ec93e9eda2f4c0e102350de7e8a (patch)
treee49260a9abcfa48c4c1d103b5c08963778baf0fc /remove-vm
parent9a0bf1a425a77b85aa90d22f72a50dc15d709529 (diff)
downloadansibleness-0505986743df1ec93e9eda2f4c0e102350de7e8a.tar.gz
Make create-vm, remove-vm read a config file
This allows me to run them on places other than my laptop.
Diffstat (limited to 'remove-vm')
-rwxr-xr-xremove-vm10
1 files changed, 5 insertions, 5 deletions
diff --git a/remove-vm b/remove-vm
index 680bef4..363f2a0 100755
--- a/remove-vm
+++ b/remove-vm
@@ -7,14 +7,14 @@ set -eu
# Command line parameters.
name="$1"
-# What volume group should we use?
-vg="exolobe1-vg"
+# Read config variables.
+. "$HOME/.config/ansibleness/vm.conf"
# Shut down and remove the VM, if it exists.
-if virsh list --all | grep -F "$name" > /dev/null
+if virsh -c qemu:///system list --all | grep -F "$name" > /dev/null
then
- virsh destroy "$name" || true
- virsh undefine "$name"
+ virsh -c qemu:///system destroy "$name" || true
+ virsh -c qemu:///system undefine "$name"
fi
# Remove the LV, if it exists.