Split up playbooks into host-level and guest-level

This commit is contained in:
Marty Oehme 2025-02-21 11:41:14 +01:00
parent bf1e99b197
commit 8a77b201bd
Signed by: Marty
GPG key ID: 4E535BC19C61886E
3 changed files with 105 additions and 72 deletions

32
host.yaml Normal file
View file

@ -0,0 +1,32 @@
# # The subvol collection seems to be misbehaving?
# # https://github.com/ansible-collections/community.general/issues/7098
# # (and btrfs_subvol module working)
# - name: Create void btrfs subvol
# hosts: host
# vars:
# btrfs_target: 441a90a5-3da2-46ce-9e32-987569b746c9
# mount_dir: /mnt/void
# become: true
# tasks:
# - name: Create @voidroot subvool under root
# community.general.btrfs_subvolume:
# state: present
# name: "/@"
# filesystem_uuid: "{{ btrfs_target }}"
- name: Create voidlinux guest
hosts: host
become: true
vars:
mount_dir: /mnt/void
tarball_url: "https://repo-default.voidlinux.org/live/current/void-x86_64-ROOTFS-20250202.tar.xz"
tasks:
- name: Unpack rootfs
ansible.builtin.unarchive:
remote_src: yes # we already downloaded it to the 'remote' system
src: "{{ tarball_url }}"
dest: "{{ mount_dir }}"
# ONLY run if this file does not exist (could use any rootfs file to check)
creates: "{{ mount_dir }}/etc/os-release"
# - name: Mount /boot part into voidroot mount