2018-05-09 16:19:11 +02:00
|
|
|
---
|
|
|
|
- name: Ensure dependencies are installed.
|
|
|
|
apt:
|
2018-09-28 05:17:50 +02:00
|
|
|
name:
|
|
|
|
- apt-transport-https
|
|
|
|
- ca-certificates
|
2024-03-06 12:15:42 +01:00
|
|
|
- python3-debian
|
2018-05-09 16:19:11 +02:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add Kubernetes repository.
|
2024-03-01 16:57:05 +01:00
|
|
|
deb822_repository:
|
|
|
|
name: kubernetes
|
|
|
|
types: deb
|
|
|
|
uris: "{{ kubernetes_apt_repository }}"
|
|
|
|
suites: /
|
|
|
|
signed_by: "{{ kubernetes_apt_repository }}/Release.key"
|
2024-03-06 12:25:22 +01:00
|
|
|
register: kubernetes_repository
|
|
|
|
|
2024-03-06 12:41:19 +01:00
|
|
|
- name: Update Apt cache.
|
|
|
|
apt:
|
2024-03-06 12:25:22 +01:00
|
|
|
update_cache: true
|
2024-03-06 12:40:49 +01:00
|
|
|
when: kubernetes_repository.changed
|
2018-09-28 06:19:56 +02:00
|
|
|
|
|
|
|
- name: Add Kubernetes apt preferences file to pin a version.
|
|
|
|
template:
|
|
|
|
src: apt-preferences-kubernetes.j2
|
|
|
|
dest: /etc/apt/preferences.d/kubernetes
|
2020-08-20 19:23:45 +02:00
|
|
|
mode: 0644
|