#
# Cookbook:: kosmos_kvm
# Recipe:: host
#

package %w(virtinst libvirt-daemon-system)

directory "/var/lib/libvirt/images/base" do
  recursive true
  owner "libvirt-qemu"
  group "kvm"
  mode "0750"
end

# Base Ubuntu 20.04 image
remote_file "/var/lib/libvirt/images/base/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.qcow2" do
  source "http://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64-disk-kvm.img"
  owner "libvirt-qemu"
  group "kvm"
  mode "0640"
end

cookbook_file "/usr/local/sbin/create_vm" do
  source "create_vm"
  mode "0750"
end
