Created
May 16, 2023 09:37
-
-
Save karubits/8236e457ce308ef39245614c05fa91b7 to your computer and use it in GitHub Desktop.
Jinja 2 Tempalte for Debian's sources.list file for all releases of Debian with archive repo handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# {{ ansible_managed }} | |
{% if ansible_distribution_major_version | int <= 9 %} | |
# πππππ Debian apt archives πππππ | |
deb http://archive.debian.org/debian/ {{ ansible_distribution_release }} main contrib {% if ansible_virtualization_role == 'host' %}non-free{% endif %} | |
{% if ansible_distribution_major_version | int == 9 %} | |
deb http://archive.debian.org/debian/ {{ ansible_distribution_release }}-proposed-updates main contrib | |
{% endif %} | |
deb http://archive.debian.org/debian-security {{ ansible_distribution_release }}/updates main contrib {% if ansible_virtualization_role == 'host' %}non-free{% endif %} | |
# If you are seeing this. Upgrade me!! | |
{% endif %} | |
{% if ansible_distribution_major_version | int >= 10 %} | |
deb http://deb.debian.org/debian/ {{ ansible_distribution_release }} main contrib{% if ansible_virtualization_role == 'host' %} non-free{% endif %} | |
deb http://deb.debian.org/debian/ {{ ansible_distribution_release }}-updates main contrib{% if ansible_virtualization_role == 'host' %} non-free{% endif %} | |
{% if ansible_distribution_release == 'buster' %} | |
deb http://security.debian.org/ {{ ansible_distribution_release }}/updates main contrib{% if ansible_virtualization_role == 'host' %}non-free{% endif %} | |
{% elif ansible_distribution_release == 'bullseye' %} | |
deb http://security.debian.org/debian-security {{ ansible_distribution_release }}-security main contrib {% if ansible_virtualization_role == 'host' %}non-free{% endif %} | |
{% elif ansible_distribution_release == 'bookworm' %} | |
deb http://security.debian.org/debian-security {{ ansible_distribution_release }}-security main contrib {% if ansible_virtualization_role == 'host' %}non-free-firmware non-free{% endif %} | |
{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example one (bullseye)
Example 2 for legacy systems: