From a8ed657fb3412ed5074e5b4fc472bc5363a09527 Mon Sep 17 00:00:00 2001 From: Nathan Douglas Date: Fri, 1 Mar 2024 10:57:05 -0500 Subject: [PATCH] deb822_repository format --- defaults/main.yml | 6 +++--- tasks/setup-Debian.yml | 29 ++++++----------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index e850ed0..53c2fd3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -51,9 +51,9 @@ kubernetes_apiserver_advertise_address: '' kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}' kubernetes_ignore_preflight_errors: 'all' -kubernetes_apt_release_channel: "stable" -kubernetes_apt_keyring_file: "/etc/apt/keyrings/kubernetes-apt-keyring.asc" -kubernetes_apt_repository: "deb [signed-by={{ kubernetes_apt_keyring_file }}] https://pkgs.k8s.io/core:/{{ kubernetes_apt_release_channel }}:/v{{ kubernetes_version }}/deb/ /" +kubernetes_apt_release_channel: main +kubernetes_apt_repository: "https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/deb/" +kubernetes_apt_ignore_key_error: false kubernetes_yum_base_url: "https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/rpm/" kubernetes_yum_gpg_key: "https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/rpm/repodata/repomd.xml.key" diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 7c77ae5..3b55e7c 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -6,30 +6,13 @@ - ca-certificates state: present -- name: Prepare apt keyring directory. - ansible.builtin.file: - path: "{{ kubernetes_apt_keyring_file | dirname }}" - state: directory - mode: 0755 - -- name: Get Kubernetes apt key. - ansible.builtin.get_url: - url: "https://pkgs.k8s.io/core:/{{ kubernetes_apt_release_channel }}:/v{{ kubernetes_version }}/deb/Release.key" - dest: "{{ kubernetes_apt_keyring_file }}" - mode: '0644' - force: true - -- name: Be sure deprecated Kubernetes repository is absent. - file: - path: "/etc/apt/sources.list.d/apt_kubernetes_io.list" - state: absent - - name: Add Kubernetes repository. - ansible.builtin.apt_repository: - repo: "{{ kubernetes_apt_repository }}" - filename: pkgs_k8s_io - state: present - update_cache: true + deb822_repository: + name: kubernetes + types: deb + uris: "{{ kubernetes_apt_repository }}" + suites: / + signed_by: "{{ kubernetes_apt_repository }}/Release.key" - name: Add Kubernetes apt preferences file to pin a version. template: