diff --git a/dev/host_vars/hypervisor.yml b/dev/host_vars/hypervisor.yml new file mode 100644 index 0000000..d292c03 --- /dev/null +++ b/dev/host_vars/hypervisor.yml @@ -0,0 +1,11 @@ +# base +allow_reboot: false +manage_network: false + +# libvirt +libvirt_users: vagrant +libvirt_isos: + - url: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.4.0-amd64-netinst.iso + hash: sha256:ab3763d553330e90869487a6843c88f1d4aa199333ff16b653e60e59ac1fc60b + - url: https://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-10.4.0-i386-netinst.iso + hash: sha256:549966a43224f237c46ee4397901ec9fd6feae74abb1e6f6baa0078acf77a936 diff --git a/dev/hypervisor.yml b/dev/hypervisor.yml new file mode 100644 index 0000000..6886a2e --- /dev/null +++ b/dev/hypervisor.yml @@ -0,0 +1,9 @@ +- name: Install Hypervisor + hosts: all + become: true + vars_files: + - host_vars/hypervisor.yml + roles: + - ansible + - base + - libvirt diff --git a/roles/base/defaults/main.yml b/roles/base/defaults/main.yml index bcb8261..825c01c 100644 --- a/roles/base/defaults/main.yml +++ b/roles/base/defaults/main.yml @@ -1,2 +1,3 @@ manage_network: false +network_type: static allow_reboot: true diff --git a/roles/libvirt/tasks/main.yml b/roles/libvirt/tasks/main.yml index c61f41e..29e9080 100644 --- a/roles/libvirt/tasks/main.yml +++ b/roles/libvirt/tasks/main.yml @@ -15,3 +15,13 @@ append: yes with_items: "{{ libvirt_users }}" when: libvirt_users is defined + +- name: Download GNU/Linux ISOs + get_url: + url: "{{ item.url }}" + dest: /var/lib/libvirt/images + checksum: "{{ item.hash }}" + owner: libvirt-qemu + group: libvirt-qemu + loop: "{{ libvirt_isos }}" + when: libvirt_isos is defined