Skip to content

Commit

Permalink
ansible: migrate to the k8s community-owned repositories
Browse files Browse the repository at this point in the history
The legacy Google-hosted repositories went away on March 4, 2024.
It's not possible to install Kubernetes packages from the legacy
Google-hosted package repositories any longer.

Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
  • Loading branch information
fmuyassarov authored and askervin committed Jul 2, 2024
1 parent 2674a29 commit a2aa924
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions test/e2e/playbook/provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,34 @@
- swapoff --all
when: ansible_swaptotal_mb > 0

- name: Download public signing key for Kubernetes
ansible.builtin.apt_key:
- name: Add Kubernetes APT repository to sources.list.d
ansible.builtin.copy:
content: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/ /"
dest: /etc/apt/sources.list.d/kubernetes.list
mode: '0644'
when: ansible_facts['distribution'] == "Ubuntu"

- name: Download Kubernetes APT key
ansible.builtin.get_url:
url: https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/Release.key
state: present
dest: /tmp/kubernetes-release.key
mode: '0644'
when: ansible_facts['distribution'] == "Ubuntu"

- name: Add apt repository for Kubernetes
ansible.builtin.apt_repository:
repo: "https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/ /"
state: present
filename: /etc/apt/sources.list.d/kubernetes.list
- name: Convert the Kubernetes APT key to keyring format
ansible.builtin.command:
cmd: gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg /tmp/kubernetes-release.key
when: ansible_facts['distribution'] == "Ubuntu"

- name: Clean up temporary key file
ansible.builtin.file:
path: /tmp/kubernetes-release.key
state: absent
when: ansible_facts['distribution'] == "Ubuntu"

- name: Update APT package index
ansible.builtin.apt:
update_cache: yes
when: ansible_facts['distribution'] == "Ubuntu"

- name: Add yum repository for Kubernetes
Expand Down

0 comments on commit a2aa924

Please sign in to comment.