small wrapper script
This commit is contained in:
parent
50146970e2
commit
36f63187f1
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
- hosts: localhost
|
|
|
@ -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
|
Loading…
Reference in New Issue