fix(bootstrap): repair version-specific package availability across distributions
This commit is contained in:
@@ -10,38 +10,54 @@
|
||||
else 'sid' if (os_version | string) == 'unstable'
|
||||
else 'trixie'
|
||||
}}
|
||||
bootstrap_debian_version_packages: >-
|
||||
bootstrap_debian_package_config: >-
|
||||
{{
|
||||
lookup('vars', bootstrap_var_key)
|
||||
}}
|
||||
bootstrap_debian_base_packages: >-
|
||||
{{
|
||||
bootstrap_debian_package_config.base
|
||||
| default([])
|
||||
| reject('equalto', '')
|
||||
| list
|
||||
}}
|
||||
bootstrap_debian_base_list: >-
|
||||
bootstrap_debian_extra_packages: >-
|
||||
{{
|
||||
bootstrap_debian_base
|
||||
bootstrap_debian_package_config.extra
|
||||
| default([])
|
||||
| reject('equalto', '')
|
||||
| list
|
||||
}}
|
||||
bootstrap_debian_extra_list: "{{ bootstrap_debian_version_packages | difference(bootstrap_debian_base_list) }}"
|
||||
bootstrap_debian_base: "{{ bootstrap_debian_base_list | join(',') }}"
|
||||
bootstrap_debian_extra: >-
|
||||
bootstrap_debian_base_csv: "{{ bootstrap_debian_base_packages | join(',') }}"
|
||||
bootstrap_debian_extra_args: >-
|
||||
{{
|
||||
(
|
||||
bootstrap_debian_extra_list
|
||||
)
|
||||
| reject('equalto', '')
|
||||
bootstrap_debian_extra_packages
|
||||
| join(' ')
|
||||
}}
|
||||
block:
|
||||
- name: Validate Debian package configuration
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- bootstrap_debian_package_config is mapping
|
||||
- bootstrap_debian_package_config.base is defined
|
||||
- bootstrap_debian_package_config.base is sequence
|
||||
- bootstrap_debian_package_config.base is not string
|
||||
- bootstrap_debian_package_config.extra is defined
|
||||
- bootstrap_debian_package_config.extra is sequence
|
||||
- bootstrap_debian_package_config.extra is not string
|
||||
fail_msg: "bootstrap package definition for {{ bootstrap_var_key }} must be a mapping with base/extra lists."
|
||||
quiet: true
|
||||
|
||||
- name: Install Debian base system
|
||||
ansible.builtin.command: >-
|
||||
debootstrap --include={{ bootstrap_debian_base }}
|
||||
debootstrap --include={{ bootstrap_debian_base_csv }}
|
||||
{{ bootstrap_debian_release }} /mnt http://deb.debian.org/debian/
|
||||
register: bootstrap_debian_base_result
|
||||
changed_when: bootstrap_debian_base_result.rc == 0
|
||||
|
||||
- name: Install extra packages
|
||||
ansible.builtin.command: "{{ chroot_command }} apt install -y {{ bootstrap_debian_extra }}"
|
||||
when: bootstrap_debian_extra_packages | length > 0
|
||||
ansible.builtin.command: "{{ chroot_command }} apt install -y {{ bootstrap_debian_extra_args }}"
|
||||
register: bootstrap_debian_extra_result
|
||||
changed_when: bootstrap_debian_extra_result.rc == 0
|
||||
|
||||
|
||||
@@ -3,16 +3,43 @@
|
||||
vars:
|
||||
bootstrap_ubuntu_release: >-
|
||||
{{ 'plucky' if bootstrap_os_key == 'ubuntu' else 'noble' }}
|
||||
bootstrap_ubuntu_extra: >-
|
||||
bootstrap_ubuntu_package_config: >-
|
||||
{{
|
||||
lookup('vars', bootstrap_var_key)
|
||||
| reject('equalto', '')
|
||||
| join(' ')
|
||||
}}
|
||||
bootstrap_ubuntu_base_packages: >-
|
||||
{{
|
||||
bootstrap_ubuntu_package_config.base
|
||||
| default([])
|
||||
| reject('equalto', '')
|
||||
| list
|
||||
}}
|
||||
bootstrap_ubuntu_extra_packages: >-
|
||||
{{
|
||||
bootstrap_ubuntu_package_config.extra
|
||||
| default([])
|
||||
| reject('equalto', '')
|
||||
| list
|
||||
}}
|
||||
bootstrap_ubuntu_base_csv: "{{ bootstrap_ubuntu_base_packages | join(',') }}"
|
||||
bootstrap_ubuntu_extra: "{{ bootstrap_ubuntu_extra_packages | join(' ') }}"
|
||||
block:
|
||||
- name: Validate Ubuntu package configuration
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- bootstrap_ubuntu_package_config is mapping
|
||||
- bootstrap_ubuntu_package_config.base is defined
|
||||
- bootstrap_ubuntu_package_config.base is sequence
|
||||
- bootstrap_ubuntu_package_config.base is not string
|
||||
- bootstrap_ubuntu_package_config.extra is defined
|
||||
- bootstrap_ubuntu_package_config.extra is sequence
|
||||
- bootstrap_ubuntu_package_config.extra is not string
|
||||
fail_msg: "bootstrap package definition for {{ bootstrap_var_key }} must be a mapping with base/extra lists."
|
||||
quiet: true
|
||||
|
||||
- name: Install Ubuntu base system
|
||||
ansible.builtin.command: >-
|
||||
debootstrap --include=linux-image-generic
|
||||
debootstrap --include={{ bootstrap_ubuntu_base_csv }}
|
||||
{{ bootstrap_ubuntu_release }} /mnt
|
||||
http://archive.ubuntu.com/ubuntu/
|
||||
register: bootstrap_ubuntu_base_result
|
||||
@@ -35,6 +62,7 @@
|
||||
changed_when: bootstrap_ubuntu_update_result.rc == 0
|
||||
|
||||
- name: Install extra packages
|
||||
when: bootstrap_ubuntu_extra_packages | length > 0
|
||||
ansible.builtin.command: "{{ chroot_command }} apt install -y {{ bootstrap_ubuntu_extra }}"
|
||||
register: bootstrap_ubuntu_extra_result
|
||||
changed_when: bootstrap_ubuntu_extra_result.rc == 0
|
||||
|
||||
@@ -22,7 +22,6 @@ bootstrap_rhel_base:
|
||||
- "{{ 'qemu-guest-agent' if hypervisor_type in ['libvirt', 'proxmox'] else '' }}"
|
||||
- "{{ 'open-vm-tools' if hypervisor_type == 'vmware' else '' }}"
|
||||
- vim
|
||||
- zram-generator
|
||||
- zstd
|
||||
|
||||
bootstrap_rhel_versioned:
|
||||
@@ -31,6 +30,7 @@ bootstrap_rhel_versioned:
|
||||
- "{{ 'grub2-tools-extra' if os_version_major | default('') in ['8', '9'] else '' }}"
|
||||
- "{{ 'python39' if os_version_major | default('') == '8' else 'python' }}"
|
||||
- "{{ 'kernel' if os_version_major | default('') == '10' else '' }}"
|
||||
- "{{ 'zram-generator' if os_version_major | default('') in ['9', '10'] else '' }}"
|
||||
|
||||
bootstrap_rhel_common: "{{ bootstrap_rhel_base + bootstrap_rhel_versioned }}"
|
||||
|
||||
@@ -39,10 +39,10 @@ bootstrap_rhel9: "{{ bootstrap_rhel_common }}"
|
||||
bootstrap_rhel10: "{{ bootstrap_rhel_common }}"
|
||||
|
||||
bootstrap_almalinux:
|
||||
"{{ bootstrap_rhel_base + ['grub2', 'grub2-efi', 'dbus-daemon', 'lrzsz', 'nfsv4-client-utils', 'nc', 'ppp'] }}"
|
||||
"{{ bootstrap_rhel_base + ['grub2', 'grub2-efi', 'dbus-daemon', 'lrzsz', 'nfsv4-client-utils', 'nc', 'ppp', 'zram-generator'] }}"
|
||||
|
||||
bootstrap_rocky:
|
||||
"{{ bootstrap_rhel_base + ['grub2', 'grub2-efi', 'nfsv4-client-utils', 'nc', 'ppp', 'telnet', 'util-linux-core', 'wget'] }}"
|
||||
"{{ bootstrap_rhel_base + ['grub2', 'grub2-efi', 'nfsv4-client-utils', 'nc', 'ppp', 'telnet', 'util-linux-core', 'wget', 'zram-generator'] }}"
|
||||
|
||||
bootstrap_almalinux8: "{{ bootstrap_almalinux }}"
|
||||
bootstrap_almalinux9: "{{ bootstrap_almalinux }}"
|
||||
@@ -99,7 +99,7 @@ bootstrap_fedora41: "{{ bootstrap_fedora }}"
|
||||
bootstrap_fedora42: "{{ bootstrap_fedora }}"
|
||||
bootstrap_fedora43: "{{ bootstrap_fedora }}"
|
||||
|
||||
bootstrap_debian_base:
|
||||
bootstrap_debian_base_common:
|
||||
- btrfs-progs
|
||||
- cron
|
||||
- gnupg
|
||||
@@ -117,12 +117,11 @@ bootstrap_debian_base:
|
||||
- python3
|
||||
- xfsprogs
|
||||
|
||||
bootstrap_debian_extra:
|
||||
bootstrap_debian_extra_common:
|
||||
- apparmor-utils
|
||||
- bat
|
||||
- chrony
|
||||
- curl
|
||||
- duf
|
||||
- entr
|
||||
- "{{ 'firewalld' if system_cfg.features.firewall.backend == 'firewalld' and system_cfg.features.firewall.enabled | bool else '' }}"
|
||||
- "{{ 'ufw' if system_cfg.features.firewall.backend == 'ufw' and system_cfg.features.firewall.enabled | bool else '' }}"
|
||||
@@ -140,12 +139,9 @@ bootstrap_debian_extra:
|
||||
- ripgrep
|
||||
- rsync
|
||||
- screen
|
||||
- software-properties-common
|
||||
- sudo
|
||||
- syslog-ng
|
||||
- systemd-zram-generator
|
||||
- tcpd
|
||||
- tldr
|
||||
- "{{ 'tpm2-tools' if system_cfg.luks.enabled else '' }}"
|
||||
- "{{ 'qemu-guest-agent' if hypervisor_type in ['libvirt', 'proxmox'] else '' }}"
|
||||
- "{{ 'open-vm-tools' if hypervisor_type == 'vmware' else '' }}"
|
||||
@@ -153,30 +149,44 @@ bootstrap_debian_extra:
|
||||
- wget
|
||||
- zstd
|
||||
|
||||
bootstrap_debian_versioned:
|
||||
- "{{ 'linux-image-amd64' if (os_version | string) in ['10', '11', '13', 'unstable'] else '' }}"
|
||||
bootstrap_debian_extra_versioned:
|
||||
- linux-image-amd64
|
||||
- "{{ 'duf' if (os_version | string) not in ['10', '11'] else '' }}"
|
||||
- "{{ 'fastfetch' if (os_version | string) in ['12', '13', 'unstable'] else '' }}"
|
||||
- "{{ 'neofetch' if (os_version | string) == '12' else '' }}"
|
||||
- "{{ 'software-properties-common' if (os_version | string) not in ['13', 'unstable'] else '' }}"
|
||||
- "{{ 'systemd-zram-generator' if (os_version | string) not in ['10', '11'] else '' }}"
|
||||
- "{{ 'tldr' if (os_version | string) not in ['13', 'unstable'] else '' }}"
|
||||
|
||||
bootstrap_debian_common: "{{ bootstrap_debian_base + bootstrap_debian_extra + bootstrap_debian_versioned }}"
|
||||
bootstrap_debian:
|
||||
base: "{{ bootstrap_debian_base_common }}"
|
||||
extra: "{{ bootstrap_debian_extra_common + bootstrap_debian_extra_versioned }}"
|
||||
|
||||
bootstrap_debian10: "{{ bootstrap_debian_common }}"
|
||||
bootstrap_debian11: "{{ bootstrap_debian_common }}"
|
||||
bootstrap_debian12: "{{ bootstrap_debian_common }}"
|
||||
bootstrap_debian13: "{{ bootstrap_debian_common }}"
|
||||
bootstrap_debianunstable: "{{ bootstrap_debian_common }}"
|
||||
bootstrap_debian10: "{{ bootstrap_debian }}"
|
||||
bootstrap_debian11: "{{ bootstrap_debian }}"
|
||||
bootstrap_debian12: "{{ bootstrap_debian }}"
|
||||
bootstrap_debian13: "{{ bootstrap_debian }}"
|
||||
bootstrap_debianunstable: "{{ bootstrap_debian }}"
|
||||
|
||||
bootstrap_ubuntu:
|
||||
"{{
|
||||
bootstrap_debian_base + bootstrap_debian_extra +
|
||||
['bash-completion', 'dnsutils', 'eza', 'fdupes', 'fio', 'ncurses-term', 'traceroute', 'util-linux-extra', 'yq', 'zoxide']
|
||||
}}"
|
||||
base:
|
||||
- linux-image-generic
|
||||
extra: >-
|
||||
{{
|
||||
bootstrap_debian_base_common
|
||||
+ bootstrap_debian_extra_common
|
||||
+ ['bash-completion', 'dnsutils', 'duf', 'eza', 'fdupes', 'fio', 'ncurses-term', 'software-properties-common', 'systemd-zram-generator', 'tldr', 'traceroute', 'util-linux-extra', 'yq', 'zoxide']
|
||||
}}
|
||||
|
||||
bootstrap_ubuntu_lts:
|
||||
"{{
|
||||
bootstrap_debian_base + bootstrap_debian_extra +
|
||||
['bash-completion', 'dnsutils', 'eza', 'fdupes', 'fio', 'ncurses-term', 'traceroute', 'util-linux-extra', 'yq', 'zoxide']
|
||||
}}"
|
||||
base:
|
||||
- linux-image-generic
|
||||
extra: >-
|
||||
{{
|
||||
bootstrap_debian_base_common
|
||||
+ bootstrap_debian_extra_common
|
||||
+ ['bash-completion', 'dnsutils', 'duf', 'eza', 'fdupes', 'fio', 'ncurses-term', 'software-properties-common', 'systemd-zram-generator', 'tldr', 'traceroute', 'util-linux-extra', 'yq', 'zoxide']
|
||||
}}
|
||||
|
||||
bootstrap_archlinux:
|
||||
- base
|
||||
|
||||
Reference in New Issue
Block a user