diff --git a/libvirt/clean.yml b/libvirt/clean.yml deleted file mode 100644 index 27e9030..0000000 --- a/libvirt/clean.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- hosts: localhost \ No newline at end of file diff --git a/mirror-vm b/mirror-vm new file mode 100755 index 0000000..8872732 --- /dev/null +++ b/mirror-vm @@ -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 diff --git a/qemu/run-vm.yml b/qemu/run.yml similarity index 100% rename from qemu/run-vm.yml rename to qemu/run.yml