From 21015e054ffbf5c31d2ec3ac522ebc288de4eebf Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 28 Oct 2023 01:30:25 +0200 Subject: [PATCH] Update apt sources and template --- tasks/sources_ethz.yml | 30 +++++++++ templates/apt.sources.list.j2 | 121 +++++----------------------------- 2 files changed, 48 insertions(+), 103 deletions(-) diff --git a/tasks/sources_ethz.yml b/tasks/sources_ethz.yml index 1e98785..d33af3a 100644 --- a/tasks/sources_ethz.yml +++ b/tasks/sources_ethz.yml @@ -16,6 +16,36 @@ - apt-transport-https state: present +- name: Set ETHZ debian packages to main + ansible.builtin.set_fact: + l3d_pkgs__debian_packages_version: 'main contrib' + when: + - not l3d_pkgs__ethz_contrib | bool + - not l3d_pkgs__ethz_non_free | bool + +- name: Set ETHZ debian packages to main contrib + ansible.builtin.set_fact: + l3d_pkgs__debian_packages_version: 'main contrib' + when: + - l3d_pkgs__ethz_contrib | bool + - not l3d_pkgs__ethz_non_free | bool + +- name: Set ETHZ debian packages to main contrib non-free + ansible.builtin.set_fact: + l3d_pkgs__debian_packages_version: 'main contrib non-free' + when: + - l3d_pkgs__ethz_contrib | bool + - l3d_pkgs__ethz_non_free | bool + - not ansible_distribution_major_version >= '12' + +- name: Set ETHZ debian packages to main contrib non-free non-free-firmware + ansible.builtin.set_fact: + l3d_pkgs__debian_packages_version: 'main contrib non-free non-free-firmware' + when: + - l3d_pkgs__ethz_contrib | bool + - l3d_pkgs__ethz_non_free | bool + - ansible_distribution_major_version >= '12' + - name: Add ETH zurich apt for Debian become: true ansible.builtin.template: diff --git a/templates/apt.sources.list.j2 b/templates/apt.sources.list.j2 index 73a7b4f..cad4d17 100644 --- a/templates/apt.sources.list.j2 +++ b/templates/apt.sources.list.j2 @@ -1,116 +1,31 @@ +{{ ansible_managed | comment }} # Debian mirror der ETH Zürich # https://debian.ethz.ch/ # https://wiki.debianforum.de/Sources.list # HTTPS mirror: -deb https://debian.ethz.ch/debian {{ ansible_distribution_release }} main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n' -}} -deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }} main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n\n' -}} +deb https://debian.ethz.ch/debian {{ ansible_distribution_release }} {{ l3d_pkgs__debian_packages_version }} +deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }} {{ l3d_pkgs__debian_packages_version }} -{%- if l3d_pkgs__ethz_security | bool -%} -{{ '# Inofficial Debian Security Mirror\n' }} -{%- if ansible_distribution_major_version >= '11' -%} -deb https://security.debian.ethz.ch/ {{ ansible_distribution_release }}-security main -{%- else -%} -deb https://security.debian.ethz.ch/ {{ ansible_distribution_release }}/updates main -{%- endif -%} - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n' -}} -{%- if ansible_distribution_major_version >= '11' -%} -deb-src https://security.debian.ethz.ch/ {{ ansible_distribution_release }}-security main -{%- else -%} -deb-src https://security.debian.ethz.ch/ {{ ansible_distribution_release }}/updates main -{%- endif -%} - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n\n' -}} -{%- endif -%} +{% if ansible_distribution_major_version >= '11' %} +deb https://security.debian.ethz.ch/ {{ ansible_distribution_release }}-security {{ l3d_pkgs__debian_packages_version }} +deb-src https://security.debian.ethz.ch/ {{ ansible_distribution_release }}-security {{ l3d_pkgs__debian_packages_version }} +{% else %} +deb https://security.debian.ethz.ch/ {{ ansible_distribution_release }}/updates {{ l3d_pkgs__debian_packages_version }} +deb-src https://security.debian.ethz.ch/ {{ ansible_distribution_release }}/updates {{ l3d_pkgs__debian_packages_version }} +{% endif %} -{%- if l3d_pkgs__ethz_updates -%} +{% if l3d_pkgs__ethz_updates %} # {{ ansible_distribution_release }}-updates, previously known as 'volatile' -deb https://debian.ethz.ch/debian {{ ansible_distribution_release }}-updates main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n' -}} -deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }}-updates main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n\n' -}} -{%- endif -%} +deb https://debian.ethz.ch/debian {{ ansible_distribution_release }}-updates {{ l3d_pkgs__debian_packages_version }} +deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }}-updates {{ l3d_pkgs__debian_packages_version }} +{% endif %} -{%- if l3d_pkgs__ethz__backports -%} +{% if l3d_pkgs__ethz__backports %} # {{ ansible_distribution_release }}-backports -deb https://debian.ethz.ch/debian {{ ansible_distribution_release }}-backports main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n' -}} -deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }}-backports main - {%- if l3d_pkgs__ethz_contrib | bool -%} - {{- ' contrib' -}} - {%- endif -%} - {%- if l3d_pkgs__ethz_non_free | bool -%} - {{- ' non-free' -}} - {%- endif -%} - {%- if ansible_distribution_major_version >= '12' and l3d_pkgs__ethz_non_free_firmware | bool -%} - {{- ' non-free-firmware' -}} - {%- endif -%} - {{- '\n\n' -}} -{%- endif -%} +deb https://debian.ethz.ch/debian {{ ansible_distribution_release }}-backports {{ l3d_pkgs__debian_packages_version }} +deb-src https://debian.ethz.ch/debian {{ ansible_distribution_release }}-backports {{ l3d_pkgs__debian_packages_version }} +{% endif %} # Contact for proplems with the mirror: # https://readme.phys.ethz.ch/services/contact/