From 6a06452d84e001e9758a83fcb948d704120348b8 Mon Sep 17 00:00:00 2001 From: $full_name <$email> Date: Thu, 2 Nov 2023 18:57:14 +0100 Subject: [PATCH] Fix kubernetes repository Fixes #9 - implement new repo for redhat and debian --- roles/install_devops_tools/tasks/main.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/roles/install_devops_tools/tasks/main.yml b/roles/install_devops_tools/tasks/main.yml index 3138cb2..168c623 100644 --- a/roles/install_devops_tools/tasks/main.yml +++ b/roles/install_devops_tools/tasks/main.yml @@ -2,8 +2,8 @@ ansible.builtin.yum_repository: name: "kubernetes" description: "Kubernetes Stable" - baseurl: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-$basearch" - gpgkey: "https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" + baseurl: "https://pkgs.k8s.io/core:/stable:/v1.28/rpm/" + gpgkey: "https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key" gpgcheck: true enabled: true when: ansible_facts['os_family'] == "RedHat" @@ -26,15 +26,14 @@ - name: "Add repository for kubectl (Debian)" when: ansible_facts['os_family'] == "Debian" block: - - name: "Download kubectl gpg key" - ansible.builtin.get_url: - url: "https://packages.cloud.google.com/apt/doc/apt-key.gpg" - dest: "/usr/share/keyrings/kubernetes-archive-keyring.gpg" - mode: "0644" + - name: Add an Apt signing key to a specific keyring file + ansible.builtin.apt_key: + url: https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key + keyring: /etc/apt/keyrings/kubernetes-apt-keyring.gpg - name: "Add kubectl repo" ansible.builtin.apt_repository: - repo: "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" + repo: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /" filename: "kubernetes" - name: "Add repository for Hashicorp (Debian)"