From 74661be687f6981f19568305d606207916af7d85 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 26 May 2024 23:24:58 +0200 Subject: move chaos-at-home hosts to new apt cache and harmonize sources.list config for raspios --- inventory/group_vars/all/vars.yml | 37 ++++++++++++++++++++++++++++ inventory/group_vars/chaos-at-home/vars.yml | 2 +- inventory/host_vars/ch-apt.yml | 2 ++ roles/apt-repo/base/tasks/main.yml | 5 ++++ roles/apt-repo/base/templates/Debian.list.j2 | 3 +++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/inventory/group_vars/all/vars.yml b/inventory/group_vars/all/vars.yml index 310a9784..744a338e 100644 --- a/inventory/group_vars/all/vars.yml +++ b/inventory/group_vars/all/vars.yml @@ -57,6 +57,9 @@ apt_repo_providers: kali: host: http.kali.org path: /kali + raspios: + host: archive.raspberrypi.com + path: /debian hetzner: debian: host: mirror.hetzner.de @@ -76,6 +79,9 @@ apt_repo_providers: kali: host: http.kali.org path: /kali + raspios: + host: archive.raspberrypi.com + path: /debian ffgraz: debian: host: debian.ffgraz.net @@ -95,6 +101,9 @@ apt_repo_providers: kali: host: http.kali.org path: /kali + raspios: + host: archive.raspberrypi.com + path: /debian inode: debian: host: debian.inode.at @@ -114,6 +123,9 @@ apt_repo_providers: kali: host: http.kali.org path: /kali + raspios: + host: archive.raspberrypi.com + path: /debian anexia: debian: host: debian.anexia.at @@ -133,6 +145,31 @@ apt_repo_providers: kali: host: http.kali.org path: /kali + raspios: + host: archive.raspberrypi.com + path: /debian + chaos-at-home-cache: + debian: + host: apt.chaos-at-home.org + path: /debian + debian_security: + host: apt.chaos-at-home.org + path: /debian-security + debian_archive: + host: apt.chaos-at-home.org + path: /debian-archive + ubuntu: + host: apt.chaos-at-home.org + path: /ubuntu + raspbian: + host: debian.anexia.at + path: /raspbian/raspbian + kali: + host: apt.chaos-at-home.org + path: /kali + raspios: + host: apt.chaos-at-home.org + path: /raspios acme_directory_server_le_live_v1: "https://acme-v01.api.letsencrypt.org/directory" diff --git a/inventory/group_vars/chaos-at-home/vars.yml b/inventory/group_vars/chaos-at-home/vars.yml index 0cc12f3b..645d1c0f 100644 --- a/inventory/group_vars/chaos-at-home/vars.yml +++ b/inventory/group_vars/chaos-at-home/vars.yml @@ -3,7 +3,7 @@ zsh_banner: chaos-at-home acme_account_email: admin@chaos-at-home.org -apt_repo_provider: anexia +apt_repo_provider: chaos-at-home-cache apt_repo_blackmagic_auth: username: "chaos-at-home" diff --git a/inventory/host_vars/ch-apt.yml b/inventory/host_vars/ch-apt.yml index 94373b61..2941c983 100644 --- a/inventory/host_vars/ch-apt.yml +++ b/inventory/host_vars/ch-apt.yml @@ -39,6 +39,8 @@ network: - *_network_primary_ +apt_repo_provider: anexia + spreadspace_apt_repo_components: - prometheus diff --git a/roles/apt-repo/base/tasks/main.yml b/roles/apt-repo/base/tasks/main.yml index 668f6453..27050b40 100644 --- a/roles/apt-repo/base/tasks/main.yml +++ b/roles/apt-repo/base/tasks/main.yml @@ -13,6 +13,11 @@ path: "/etc/apt/sources.list.d/{{ item }}" state: absent +- name: remove seperate raspi.list file (repo is part of the base config) + file: + path: "/etc/apt/sources.list.d/raspi.list" + state: absent + - name: update apt cache when: apt_repo_base_sources is changed command: apt-get update diff --git a/roles/apt-repo/base/templates/Debian.list.j2 b/roles/apt-repo/base/templates/Debian.list.j2 index 91531f7e..d29ced50 100644 --- a/roles/apt-repo/base/templates/Debian.list.j2 +++ b/roles/apt-repo/base/templates/Debian.list.j2 @@ -5,3 +5,6 @@ deb http://{{ apt_repo_providers[apt_repo_provider].debian_security.host }}{{ ap {% 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(' ') }} {% endif %} +{% if 'raspios' in group_names %} +deb http://{{ apt_repo_providers[apt_repo_provider].raspios.host }}{{ apt_repo_providers[apt_repo_provider].raspios.path }} {{ ansible_distribution_release }} main +{% endif %} -- cgit v1.2.3