--- # Proxmox VE 9.x (Debian 13 / trixie) sources and repo configuration using deb822 - name: "Find legacy .list APT source files on 9.x" ansible.builtin.find: paths: - /etc/apt/sources.list.d patterns: "*.list" file_type: file register: proxmox_legacy_list_files - name: "Backup and disable entries in /etc/apt/sources.list (if any)" ansible.builtin.copy: src: /etc/apt/sources.list dest: /etc/apt/sources.list.bak owner: root group: root mode: '0644' remote_src: true when: - proxmox_fix_sources - ansible_facts['os_family'] is defined ignore_errors: true - name: "Comment legacy deb lines in /etc/apt/sources.list (bookworm/proxmox)" ansible.builtin.replace: path: /etc/apt/sources.list regexp: '^(\s*deb\s+.*(proxmox|bookworm).*)$' replace: '# Disabled by Proxmox Helper Ansible role \1' when: proxmox_fix_sources ignore_errors: true - name: "Remove legacy .list files on 9.x when migrating to deb822" ansible.builtin.file: path: "{{ item.path }}" state: absent loop: "{{ proxmox_legacy_list_files.files | default([]) }}" when: proxmox_fix_sources - name: "Configure Debian Trixie deb822 sources for 9.x" ansible.builtin.copy: dest: /etc/apt/sources.list.d/debian.sources owner: root group: root mode: '0644' content: | Types: deb URIs: http://deb.debian.org/debian Suites: trixie Components: main contrib Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: http://security.debian.org/debian-security Suites: trixie-security Components: main contrib Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: http://deb.debian.org/debian Suites: trixie-updates Components: main contrib Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg when: proxmox_fix_sources - name: "Ensure pve-enterprise deb822 source is disabled on 9.x" ansible.builtin.blockinfile: path: /etc/apt/sources.list.d/pve-enterprise.sources create: true owner: root group: root mode: '0644' block: | Types: deb URIs: https://enterprise.proxmox.com/debian/pve Suites: trixie Components: pve-enterprise Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg Enabled: false when: proxmox_disable_pve_enterprise - name: "Configure pve-no-subscription deb822 source on 9.x" ansible.builtin.copy: dest: /etc/apt/sources.list.d/proxmox.sources owner: root group: root mode: '0644' content: | Types: deb URIs: http://download.proxmox.com/debian/pve Suites: trixie Components: pve-no-subscription Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg when: proxmox_enable_pve_no_subscription - name: "Configure Ceph deb822 source on 9.x (no-subscription)" ansible.builtin.copy: dest: /etc/apt/sources.list.d/ceph.sources owner: root group: root mode: '0644' content: | Types: deb URIs: http://download.proxmox.com/debian/ceph-squid Suites: trixie Components: no-subscription Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg when: proxmox_fix_ceph_repos - name: "Add disabled pve-test deb822 source on 9.x" ansible.builtin.copy: dest: /etc/apt/sources.list.d/pve-test.sources owner: root group: root mode: '0644' content: | Types: deb URIs: http://download.proxmox.com/debian/pve Suites: trixie Components: pve-test Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg Enabled: false when: proxmox_add_pvetest_repo_disabled