small wrapper script

This commit is contained in:
Daniel Liu 2021-09-16 19:38:59 -04:00
parent 50146970e2
commit 36f63187f1
3 changed files with 59 additions and 2 deletions

View File

@ -1,2 +0,0 @@
---
- hosts: localhost

59
mirror-vm Executable file
View File

@ -0,0 +1,59 @@
#!/bin/sh
help() {
cat << EOF
=-=-=-=-= mirror-vm =-=-=-=-=
Usage: mirror-vm [COMMAND]
Commands:
libvirt-install, li
creates and installs the mirror server
on a new vm using libvirt
qemu-install, qi
creates and installs the mirror server
on a new vm using qemu
libvirt-run, lr
runs a previously created libvirt vm
qemu-run, qr
runs a previously created qemu vm
clean, c
removes user files like your vm
help, h
prints this message
EOF
}
libvirt_install() {
ansible-playbook -K libvirt/main.yml
}
qemu_install() {
ansible-playbook -K qemu/main.yml
}
libvirt_run() {
echo 'libvirt-run'
}
qemu_run() {
ansible-playbook -K qemu/run.yml
}
clean() {
rm -rf userdata
}
case $1 in
li|libvirt-install) libvirt_install;;
qi|qemu-install) qemu_install;;
lr|libvirt-run) libvirt_run;;
qr|qemu-run) qemu_run;;
c|clean) clean;;
h|help|*) help;;
esac