From 2b32cc9cc4ac85dbb94e4df02d7c208b08d17224 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 27 Jul 2023 14:06:23 -0400 Subject: [PATCH] ansible: Update path for downloaded ISO images /var/lib/libvirt/images isn't world-readable by default. The ISOs are meant to be readily accessible as they should be used read-only. In the cases where VMs are run as unprivileged users (eg. with lxd), /var/lib/libvirt/images/*.iso isn't readable. Rather than loosening the mode on the images folder, the ISOs will be in a directory that is world-readable by default. Change-Id: I056c290e5b88f0baaa52eaf749d4f29b53dbb8af --- automation/ansible/roles/libvirt/vars/main.yml | 6 +++--- automation/ansible/roles/zfs/tasks/main.yml | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/automation/ansible/roles/libvirt/vars/main.yml b/automation/ansible/roles/libvirt/vars/main.yml index 3bbb2f6..de6a8f8 100644 --- a/automation/ansible/roles/libvirt/vars/main.yml +++ b/automation/ansible/roles/libvirt/vars/main.yml @@ -12,10 +12,10 @@ vm_defaults: isos: - url: https://releases.ubuntu.com/jammy/ubuntu-22.04.2-live-server-amd64.iso checksum: "sha256:5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931" - dest: /var/lib/libvirt/images/ubuntu-22.04.2-live-server-amd64.iso + dest: /var/lib/iso/ubuntu-22.04.2-live-server-amd64.iso - url: https://cdimage.debian.org/cdimage/archive/12.0.0/i386/iso-cd/debian-12.0.0-i386-netinst.iso checksum: "sha256:4f5cf17c611693d494c0a6a591b2d1e5fcd222d95e81bc555b581b2b01488f14" - dest: /var/lib/libvirt/images/debian-12.0.0-i386-netinst.iso + dest: /var/lib/iso/debian-12.0.0-i386-netinst.iso - url: https://cdimage.debian.org/cdimage/archive/12.0.0/amd64/iso-cd/debian-12.0.0-amd64-netinst.iso checksum: "sha256:3b0e9718e3653435f20d8c2124de6d363a51a1fd7f911b9ca0c6db6b3d30d53e" - dest: /var/lib/libvirt/images/debian-12.0.0-amd64-netinst.iso + dest: /var/lib/iso/debian-12.0.0-amd64-netinst.iso diff --git a/automation/ansible/roles/zfs/tasks/main.yml b/automation/ansible/roles/zfs/tasks/main.yml index 219a5e1..447224f 100644 --- a/automation/ansible/roles/zfs/tasks/main.yml +++ b/automation/ansible/roles/zfs/tasks/main.yml @@ -23,3 +23,9 @@ with_items: - libvirt - lxd +- name: Create ISO dataset + community.general.zfs: + name: 'tank/iso' + state: present + extra_zfs_properties: + mountpoint: '/var/lib/iso' -- 2.34.1