You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
992 B
59 lines
992 B
#!/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 qemu/vm libvirt/vm
|
|
}
|
|
|
|
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
|
|
|