mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2024-11-18 19:10:39 +01:00
29 lines
690 B
YAML
29 lines
690 B
YAML
---
|
|
- name: Ensure dependencies are installed.
|
|
apt:
|
|
name:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- python3-debian
|
|
state: present
|
|
|
|
- name: Add Kubernetes repository.
|
|
deb822_repository:
|
|
name: kubernetes
|
|
types: deb
|
|
uris: "{{ kubernetes_apt_repository }}"
|
|
suites: /
|
|
signed_by: "{{ kubernetes_apt_repository }}/Release.key"
|
|
register: kubernetes_repository
|
|
|
|
- name: 'Update Apt cache.'
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
when: kubernetes_repository.changed
|
|
|
|
- name: Add Kubernetes apt preferences file to pin a version.
|
|
template:
|
|
src: apt-preferences-kubernetes.j2
|
|
dest: /etc/apt/preferences.d/kubernetes
|
|
mode: 0644
|