From 378d9a88c20ddd2d42a67f2e9d8fdd644bc54465 Mon Sep 17 00:00:00 2001 From: Sandwich Date: Mon, 11 Aug 2025 21:37:25 +0200 Subject: [PATCH] Add Debian 13 (Trixie) support --- README.md | 1 + main.yml | 2 +- roles/bootstrap/tasks/main.yml | 4 +-- roles/bootstrap/vars/main.yml | 49 ++++++++++++++++++++++++++++++ roles/configuration/tasks/main.yml | 14 ++++----- roles/environment/tasks/main.yml | 4 +-- 6 files changed, 62 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b225294..c9c6ef3 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ This playbook supports multiple Linux distributions with specific versions tailo | almalinux | AlmaLinux 9.x | | debian11 | Debian 11 (Bullseye) | | debian12 | Debian 12 (Bookworm) | +| debian13 | Debian 13 (Trixie) | | fedora | Fedora 42 | | rhel8 | Red Hat Enterprise Linux 8 | | rhel9 | Red Hat Enterprise Linux 9 | diff --git a/main.yml b/main.yml index e88ea79..eee75c7 100644 --- a/main.yml +++ b/main.yml @@ -49,7 +49,7 @@ - hypervisor in ["libvirt", "proxmox", "vmware", "none"] - filesystem in ["btrfs", "ext4", "xfs"] - install_drive is defined - - os in ["archlinux", "almalinux", "debian11", "debian12", "fedora", "rhel8", "rhel9", "rhel10", "rocky", "ubuntu", "ubuntu-lts"] + - os in ["archlinux", "almalinux", "debian11", "debian12", "debian13", "fedora", "rhel8", "rhel9", "rhel10", "rocky", "ubuntu", "ubuntu-lts"] - os not in ["rhel8", "rhel9", "rhel10"] or rhel_iso is defined - (filesystem == "btrfs" and (vm_size | int) >= 10) or (filesystem != "btrfs" and (vm_size | int) >= 20) - (vm_size | float) >= ((vm_memory | float / 1024 >= 16.0) | ternary((vm_memory | float / 2048), [vm_memory | float / 1024, 4.0] | max) + 16) diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml index f8937ae..2911344 100644 --- a/roles/bootstrap/tasks/main.yml +++ b/roles/bootstrap/tasks/main.yml @@ -8,12 +8,12 @@ register: result - name: Bootstrap Debian System - when: os | lower in ['debian11', 'debian12'] + when: os | lower in ['debian11', 'debian12', 'debian13'] ansible.builtin.command: "{{ item }}" changed_when: result.rc == 0 register: result with_items: - - debootstrap --include={{ vars[os].base | join(',') }} {{ 'bullseye' if os == 'debian11' else 'bookworm' }} + - debootstrap --include={{ vars[os].base | join(',') }} {{ 'bullseye' if os == 'debian11' else 'bookworm' if os == 'debian12' else 'trixie' }} /mnt http://deb.debian.org/debian/ - arch-chroot /mnt apt install -y {{ vars[os].extra | join(' ') }} - arch-chroot /mnt apt remove -y libcups2 libavahi-common3 libavahi-common-data diff --git a/roles/bootstrap/vars/main.yml b/roles/bootstrap/vars/main.yml index e2a63e5..1a95b0a 100644 --- a/roles/bootstrap/vars/main.yml +++ b/roles/bootstrap/vars/main.yml @@ -157,6 +157,55 @@ debian12: - wget - zstd +debian13: + base: + - btrfs-progs + - cron + - gnupg + - grub-efi + - grub-efi-amd64-signed + - grub2-common + - linux-image-amd64 + - locales + - logrotate + - lvm2 + - xfsprogs + + extra: + - apparmor-utils + - bat + - chrony + - curl + - duf + - entr + - fastfetch + - firewalld + - fish + - fzf + - htop + - jq + - libpam-pwquality + - logrotate + - lrzsz + - mtr + - ncdu + - net-tools + - network-manager + - open-vm-tools + - openssh-server + - python-is-python3 + - python3 + - ripgrep + - rsync + - screen + - sudo + - syslog-ng + - systemd-zram-generator + - tcpd + - vim + - wget + - zstd + fedora: - bat - bind-utils diff --git a/roles/configuration/tasks/main.yml b/roles/configuration/tasks/main.yml index a089d5c..4df691e 100644 --- a/roles/configuration/tasks/main.yml +++ b/roles/configuration/tasks/main.yml @@ -108,7 +108,7 @@ arch-chroot /mnt systemctl enable NetworkManager {{ ' ssh' if os | lower in ['ubuntu', 'ubuntu-lts'] else - (' sshd' if os | lower not in ['debian11', 'debian12'] else '') + (' sshd' if os | lower not in ['debian11', 'debian12', 'debian13'] else '') }} {{ 'logrotate systemd-resolved systemd-timesyncd systemd-networkd' @@ -136,7 +136,7 @@ block: - name: Install Bootloader ansible.builtin.command: arch-chroot /mnt - {% if os | lower not in ["archlinux", "debian11", "debian12", "ubuntu", "ubuntu-lts"] %} /usr/sbin/efibootmgr + {% if os | lower not in ["archlinux", "debian11", "debian12", "debian13", "ubuntu", "ubuntu-lts"] %} /usr/sbin/efibootmgr -c -L '{{ os }}' -d "{{ install_drive }}" -p 1 -l '\efi\EFI\{% if os | lower in ["rhel8", "rhel9", "rhel10"] %}redhat{% else %}{{ os | lower }}{% endif %}\shimx64.efi' {% else %}/usr/sbin/grub-install --target=x86_64-efi --efi-directory={{ "/boot/efi" if os | lower in ["ubuntu", "ubuntu-lts"] else "/boot" }} @@ -154,7 +154,7 @@ backrefs: true - name: Regenerate initramfs - when: os | lower not in ["debian11", "debian12", "ubuntu", "ubuntu-lts"] + when: os | lower not in ["debian11", "debian12", "debian13", "ubuntu", "ubuntu-lts"] ansible.builtin.command: arch-chroot /mnt {% if os | lower == "archlinux" %} /usr/sbin/mkinitcpio -P {% else %} /usr/bin/dracut --regenerate-all --force @@ -164,7 +164,7 @@ - name: Generate grub config ansible.builtin.command: arch-chroot /mnt - {% if os | lower not in ["archlinux", "debian11", "debian12", "ubuntu", "ubuntu-lts"] %} + {% if os | lower not in ["archlinux", "debian11", "debian12", "debian13", "ubuntu", "ubuntu-lts"] %} /usr/sbin/grub2-mkconfig -o /boot/efi/EFI/{% if os | lower in ["rhel8", "rhel9", "rhel10"] %}redhat{% else %}{{ os | lower }}{% endif %}/grub.cfg {% else %} /usr/sbin/grub-mkconfig -o {{ "/boot/efi/EFI/ubuntu/grub.cfg" if os | lower in ["ubuntu", "ubuntu-lts"] else "/boot/grub/grub.cfg" }} @@ -178,7 +178,7 @@ failed_when: false ansible.builtin.blockinfile: path: - "{{ '/mnt/etc/vim/vimrc' if os | lower in ['debian11', 'debian12', 'ubuntu', 'ubuntu-lts'] + "{{ '/mnt/etc/vim/vimrc' if os | lower in ['debian11', 'debian12', 'debian13', 'ubuntu', 'ubuntu-lts'] else '/mnt/etc/vimrc' }}" block: | set encoding=utf-8 @@ -281,7 +281,7 @@ ansible.builtin.command: "{{ item }}" with_items: - arch-chroot /mnt /usr/sbin/useradd --create-home --user-group --groups - {{ "sudo" if os | lower in ["debian11", "debian12", "ubuntu", "ubuntu-lts"] else "wheel" }} + {{ "sudo" if os | lower in ["debian11", "debian12", "debian13", "ubuntu", "ubuntu-lts"] else "wheel" }} {{ user_name }} --password {{ user_password | password_hash('sha512') }} --shell /bin/bash - arch-chroot /mnt /usr/sbin/usermod --password '{{ root_password | password_hash('sha512') }}' root --shell /bin/bash changed_when: result.rc == 0 @@ -299,7 +299,7 @@ - name: Give sudo access to wheel group ansible.builtin.copy: - content: "{{ '%sudo ALL=(ALL) ALL' if os | lower in ['debian11', 'debian12', 'ubuntu', 'ubuntu-lts'] else '%wheel ALL=(ALL) ALL' }}" + content: "{{ '%sudo ALL=(ALL) ALL' if os | lower in ['debian11', 'debian12', 'debian13', 'ubuntu', 'ubuntu-lts'] else '%wheel ALL=(ALL) ALL' }}" dest: /mnt/etc/sudoers.d/01-wheel mode: "0440" validate: /usr/sbin/visudo --check --file=%s diff --git a/roles/environment/tasks/main.yml b/roles/environment/tasks/main.yml index 1985c39..11c82e4 100644 --- a/roles/environment/tasks/main.yml +++ b/roles/environment/tasks/main.yml @@ -90,8 +90,8 @@ loop: - { name: glibc } - { name: dnf, os: [almalinux, fedora, rhel8, rhel9, rhel10, rocky] } - - { name: debootstrap, os: [debian11, debian12, ubuntu, ubuntu-lts] } - - { name: debian-archive-keyring, os: [debian11, debian12] } + - { name: debootstrap, os: [debian11, debian12, debian13, ubuntu, ubuntu-lts] } + - { name: debian-archive-keyring, os: [debian11, debian12, debian13] } - { name: ubuntu-keyring, os: [ubuntu, ubuntu-lts] } when: "'os' not in item or os in item.os" retries: 4