Make chroot command configurable

This commit is contained in:
2026-01-02 18:53:55 +01:00
parent ce972e55dd
commit fe0b72c9d8
14 changed files with 26 additions and 30 deletions

View File

@@ -14,7 +14,7 @@
--setopt=install_weak_deps=False groupinstall -y base core
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
- >-
arch-chroot /mnt dnf --releasever=9 --setopt=install_weak_deps=False
{{ chroot_command }} /mnt dnf --releasever=9 --setopt=install_weak_deps=False
install -y {{ bootstrap_alma_extra }}
register: bootstrap_result
changed_when: bootstrap_result.rc == 0

View File

@@ -23,7 +23,7 @@
- >-
debootstrap --include={{ bootstrap_debian_base }}
{{ bootstrap_debian_release }} /mnt http://deb.debian.org/debian/
- "arch-chroot /mnt apt install -y {{ bootstrap_debian_extra }}"
- arch-chroot /mnt apt remove -y libcups2 libavahi-common3 libavahi-common-data
- "{{ chroot_command }} /mnt apt install -y {{ bootstrap_debian_extra }}"
- "{{ chroot_command }} /mnt apt remove -y libcups2 libavahi-common3 libavahi-common-data"
register: bootstrap_result
changed_when: bootstrap_result.rc == 0

View File

@@ -15,8 +15,8 @@
groupinstall -y critical-path-base core
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
- >-
arch-chroot /mnt dnf --releasever=43 --setopt=install_weak_deps=False
{{ chroot_command }} /mnt dnf --releasever=43 --setopt=install_weak_deps=False
install -y {{ bootstrap_fedora_extra }}
- arch-chroot /mnt dnf reinstall -y kernel-core
- "{{ chroot_command }} /mnt dnf reinstall -y kernel-core"
register: bootstrap_result
changed_when: bootstrap_result.rc == 0

View File

@@ -34,12 +34,7 @@
state: mounted
- name: Rebuild RPM database inside chroot
ansible.builtin.command:
argv:
- arch-chroot
- /mnt
- rpm
- --rebuilddb
ansible.builtin.command: "{{ chroot_command }} /mnt rpm --rebuilddb"
register: bootstrap_rpm_rebuild_result
changed_when: bootstrap_rpm_rebuild_result.rc == 0
@@ -60,7 +55,7 @@
| join(' ')
}}
ansible.builtin.command: >-
arch-chroot /mnt dnf --releasever={{ bootstrap_rhel_release }}
{{ chroot_command }} /mnt dnf --releasever={{ bootstrap_rhel_release }}
--setopt=install_weak_deps=False install -y {{ bootstrap_rhel_extra }}
register: bootstrap_result
changed_when: bootstrap_result.rc == 0

View File

@@ -15,7 +15,7 @@
groupinstall -y base core
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
- >-
arch-chroot /mnt dnf --releasever=9 --setopt=install_weak_deps=False
{{ chroot_command }} /mnt dnf --releasever=9 --setopt=install_weak_deps=False
install -y {{ bootstrap_rocky_extra }}
register: bootstrap_result
changed_when: bootstrap_result.rc == 0

View File

@@ -20,8 +20,8 @@
debootstrap --include={{ bootstrap_ubuntu_base }}
{{ bootstrap_ubuntu_release }} /mnt http://archive.ubuntu.com/ubuntu/
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
- arch-chroot /mnt sed -i '1s|$| universe|' /etc/apt/sources.list
- arch-chroot /mnt apt update
- "arch-chroot /mnt apt install -y {{ bootstrap_ubuntu_extra }}"
- "{{ chroot_command }} /mnt sed -i '1s|$| universe|' /etc/apt/sources.list"
- "{{ chroot_command }} /mnt apt update"
- "{{ chroot_command }} /mnt apt install -y {{ bootstrap_ubuntu_extra }}"
register: bootstrap_result
changed_when: bootstrap_result.rc == 0