feat(network): Create separate networking playbook

This commit is contained in:
Marty Oehme 2025-02-21 15:44:52 +01:00
parent f77a5c4e33
commit 457fb3517a
Signed by: Marty
GPG key ID: 4E535BC19C61886E
3 changed files with 42 additions and 16 deletions

View file

@ -12,8 +12,21 @@
# community.general.btrfs_subvolume:
# state: present
# name: "/@"
# filesystem_uuid: "{{ btrfs_target }}"
# filesystem_uuid: "{{ btrfs_root_uuid }}"
# # - name: Mount /boot part into voidroot mount
# - name: Mount btrfs subvol into mountdir
# vars:
# boot_dev_uuid:
# ansible.posix.mount:
# src: "{{ item.src }}"
# path: "{{ item.path }}"
# fstype: "{{ item.fstype }}"
# state: mounted
# with_items:
# - { fstype: 'ext4', src: '/dev/mapper/{{ vgname }}-root', path: '{{ mount_dir }}/' }
# # TODO: should take opts from fstab. Definitely needs 'boot' type option
# - { fstype: 'vfat', src: '/dev/disk/by-uuid/{{ boot_dev_uuid }}', path: '{{ mount_dir }}/boot' }
- name: Create voidlinux guest
hosts: host
become: true
@ -28,17 +41,3 @@
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
# TODO: Should be removed again at the end?
# However only after the whole PLAYBOOK has run not after this play
# not sure how to accomplish, see
# https://newbe.dev/run-an-ansible-handler-only-once-for-the-entire-playbook
# for possible solutions (especially lowest, hosts_to_restart example)
- name: Use archlinux resolvd for network access
ansible.builtin.file:
path: "{{ mount_dir }}/etc/resolv.conf"
state: touch