summaryrefslogtreecommitdiff
path: root/roles/apt-repo
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-05-09 22:00:19 +0200
committerChristian Pointner <equinox@spreadspace.org>2024-05-09 22:00:19 +0200
commit477cdee79a54f98eb2ac973ef38138cf417d7bfb (patch)
treec25b833071c69c7b7cc262111240f130018cbc92 /roles/apt-repo
parentsome more fixes for ubuntu-installer (diff)
make debian/ubuntu os release compare script much more generic
Diffstat (limited to 'roles/apt-repo')
-rw-r--r--roles/apt-repo/base/defaults/main.yml2
-rw-r--r--roles/apt-repo/base/templates/Debian.list.j22
2 files changed, 2 insertions, 2 deletions
diff --git a/roles/apt-repo/base/defaults/main.yml b/roles/apt-repo/base/defaults/main.yml
index f5d9193f..e7e48029 100644
--- a/roles/apt-repo/base/defaults/main.yml
+++ b/roles/apt-repo/base/defaults/main.yml
@@ -10,7 +10,7 @@ apt_repo_base_components:
ubuntu:
- main
- universe
- debian: "{{ ((ansible_distribution_major_version | int) <= 11) | ternary(_apt_repo_base_components_debian_.until_bullseye, _apt_repo_base_components_debian_.after_bullseye) }}"
+ debian: "{{ (ansible_distribution_release | debian_release_compare('<=', 'bullseye')) | ternary(_apt_repo_base_components_debian_.until_bullseye, _apt_repo_base_components_debian_.after_bullseye) }}"
raspbian:
- main
- rpi
diff --git a/roles/apt-repo/base/templates/Debian.list.j2 b/roles/apt-repo/base/templates/Debian.list.j2
index 61b4b164..91531f7e 100644
--- a/roles/apt-repo/base/templates/Debian.list.j2
+++ b/roles/apt-repo/base/templates/Debian.list.j2
@@ -1,6 +1,6 @@
deb http://{{ apt_repo_providers[apt_repo_provider].debian.host }}{{ apt_repo_providers[apt_repo_provider].debian.path }} {{ ansible_distribution_release }} {{ apt_repo_components | default(apt_repo_base_components.debian) | join(' ') }}
deb http://{{ apt_repo_providers[apt_repo_provider].debian.host }}{{ apt_repo_providers[apt_repo_provider].debian.path }} {{ ansible_distribution_release }}-updates {{ apt_repo_components | default(apt_repo_base_components.debian) | join(' ') }}
-{% if (ansible_distribution_major_version | int) <= 10 %}
+{% if (ansible_distribution_release | debian_release_compare('<=', 'buster')) %}
deb http://{{ apt_repo_providers[apt_repo_provider].debian_security.host }}{{ apt_repo_providers[apt_repo_provider].debian_security.path }} {{ ansible_distribution_release }}/updates {{ apt_repo_components | default(apt_repo_base_components.debian) | join(' ') }}
{% else %}
deb http://{{ apt_repo_providers[apt_repo_provider].debian_security.host }}{{ apt_repo_providers[apt_repo_provider].debian_security.path }} {{ ansible_distribution_release }}-security {{ apt_repo_components | default(apt_repo_base_components.debian) | join(' ') }}