Install system through chroot

This commit is contained in:
Marty Oehme 2025-02-21 11:41:14 +01:00
parent 9c06b98fde
commit 45f9d88890
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 53 additions and 0 deletions

View file

@ -1,2 +1,5 @@
[host]
127.0.0.1 ansible_connection=local
[guest]
/mnt/void ansible_connection=community.general.chroot

View file

@ -16,3 +16,53 @@
# community.general.btrfs_subvolume:
# name: /@voidroot
# filesystem_uuid: {{ btrfs_target }}
# Get python onto void - otherwise we can not interact through ansible
- name: Bootstrap void python
hosts: guest
gather_facts: false
tasks:
- name: install python
raw: test -e /usr/bin/python || xbps-install -y python
register: python_install
changed_when: "'installed successfully' in python_install.stdout"
- name: Void prep
hosts: guest
become: true
vars:
ansible_chroot_exe: arch-chroot
disable_root_check: true
tasks:
# Prefer booster to dracut so make sure to never install it
- name: Ignore dracut
ansible.builtin.lineinfile:
path: /etc/xbps.d/ignore-dracut.conf
line: ignorepkg=dracut
state: present
create: true # create file if absent
- name: Update xbps and system
community.general.xbps:
name:
- xbps
state: latest
update_cache: true
upgrade: true
- name: Install Base system
community.general.xbps:
name:
- base-system
state: present
- name: Get rid of temporary container metapackage
community.general.xbps:
name:
- base-container-full
state: absent
- name: Install booster
community.general.xbps:
name: booster
state: present