This role install virtualization tools qemu-kvm with additional tools (libvirtd, libvirt-client, etc)
qemu_kvm_packages
: [optional]: list of packages to be installed (see defaults/main.yml for detail)qemu_kvm_use_rhev_version
: [optional, defaulttrue
]: set use or not virt7-kvm-common-candidate repo (el7 only)qemu_kvm_remove_default_network
: [optional, defaulttrue
]: delete default qemu-kvm network
qemu_kvm_libvirtguests_onshutdown
: [optional, defaultsuspend
, ]: set ON_SHUTDOWN= variable (in /etc/sysconfig/libvirt-guests). Possible values:shutdown
orsuspend
1. Playbook qemu-kvm.yml`
- hosts:
- hostname
roles:
- qemu-kvm
2. Install
ansible-playbook --user=username --become qemu-kvm.yml
3. Configure (set the variable ON_SHUTDOWN=shutdown)
ansible-playbook --user=username --become --extra-vars="qemu_kvm_libvirtguests_onshutdown=shutdown" qemu-kvm.yml --tags=libvirt-guests-configure
or you can define the variable qemu_kvm_libvirtguests_onshutdown: "shutdown"
in host_vars\hostname
After changing the value ON_SHUTDOWN in /etc/sysconfig/libvirt-guests, the libvirt-guests service is NOT restarted automatically (otherwise all VM will be shutdown or suspended).
GPLv3 license
Vitaly Yakovenko