From 59c1431f93eed6162d9be8cbfca8bd80acbb1fda Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 12 Aug 2025 19:12:32 +0200 Subject: [PATCH] proxmox: switch to deb822 source format Debian did, Proxmox did, now we did too. Also enable ceph repository if ceph-version is set in config context. --- roles/proxmox/tasks/main.yml | 18 +-------------- roles/proxmox/tasks/repositories.yml | 33 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 roles/proxmox/tasks/repositories.yml diff --git a/roles/proxmox/tasks/main.yml b/roles/proxmox/tasks/main.yml index aadd7d0..1141b87 100644 --- a/roles/proxmox/tasks/main.yml +++ b/roles/proxmox/tasks/main.yml @@ -32,23 +32,7 @@ - include_tasks: network.yml -- name: Disable enterprise repositories - apt_repository: - repo: '{{ item }}' - state: absent - update_cache: no - loop: - - 'deb https://enterprise.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-enterprise' - - 'deb https://enterprise.proxmox.com/debian/ceph-quincy {{ ansible_distribution_release }} enterprise' - notify: update package cache - -- name: Enable no-subscription repository - apt_repository: - repo: 'deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription' - update_cache: no - notify: update package cache - -- meta: flush_handlers +- include_tasks: repositories.yml - name: Install essential packages package: diff --git a/roles/proxmox/tasks/repositories.yml b/roles/proxmox/tasks/repositories.yml new file mode 100644 index 0000000..0f1318e --- /dev/null +++ b/roles/proxmox/tasks/repositories.yml @@ -0,0 +1,33 @@ +- name: Disable enterprise repositories + deb822_repository: + name: pve-enterprise + state: absent + notify: update package cache + +- name: Enable no-subscription repositories + deb822_repository: + name: proxmox + uris: http://download.proxmox.com/debian/pve + suites: "{{ ansible_distribution_release }}" + components: pve-no-subscription + signed_by: /usr/share/keyrings/proxmox-archive-keyring.gpg + notify: update package cache + +- name: Disable ceph repositories if not needed + when: "'ceph-version' not in hostvars[inventory_hostname]" + deb822_repository: + name: ceph + state: absent + notify: update package cache + +- name: Enable no-subscription ceph repositories + when: "'ceph-version' in hostvars[inventory_hostname]" + deb822_repository: + name: ceph + uris: "http://download.proxmox.com/debian/ceph-{{ hostvars[inventory_hostname]['ceph-version'] }}" + suites: "{{ ansible_distribution_release }}" + components: no-subscription + signed_by: /usr/share/keyrings/proxmox-archive-keyring.gpg + notify: update package cache + +- meta: flush_handlers