ansible-kvm-provision/roles/kvm_provision
2022-03-08 19:55:15 +01:00
..
defaults Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
handlers Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
meta Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
tasks Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
templates Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
tests Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
vars Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00
README.md Ansible Role Create KVMs 2022-03-08 19:55:15 +01:00

KVM Provision

Provision virtual machines to local libvirt

Related to:

Requirements

Recommend:

  • Pre install and configure libvirt
  • Create your ssh key
  • Check permissions/security apparmor on qemu:///system or qemu:///session

Example Playbook

  • name: Deploys VM based on cloud image hosts: localhost gather_facts: yes vars: pool_dir: "/home/user/kvm" vm: vm_name vcpus: 1 ram_mb: 512 cleanup: no net: default ssh_pub_key: "/home/user/.ssh/id_ed25519.pub"

    tasks:

    • name: KVM Provision role include_role: name: kvm_provision vars: libvirt_pool_dir: "{{ pool_dir }}" vm_name: "{{ vm }}" vm_vcpus: "{{ vcpus }}" vm_ram_mb: "{{ ram_mb }}" vm_net: "{{ net }}" cleanup_tmp: "{{ cleanup }}" ssh_key: "{{ ssh_pub_key }}"

License

BSD