geerlingguy.ansible-role-ku.../tasks/setup-Debian.yml

39 lines
1.0 KiB
YAML
Raw Normal View History

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
2018-05-09 16:19:11 +02:00
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.
2023-11-07 15:18:40 +01:00
ansible.builtin.get_url:
2023-11-07 15:11:01 +01:00
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.
2023-11-07 15:18:40 +01:00
file:
path: "/etc/apt/sources.list.d/apt_kubernetes_io.list"
state: absent
2018-05-09 16:19:11 +02:00
- name: Add Kubernetes repository.
ansible.builtin.apt_repository:
2023-11-07 15:11:01 +01:00
repo: "{{ kubernetes_apt_repository }}"
filename: pkgs_k8s_io
2018-05-09 16:19:11 +02:00
state: present
update_cache: true
- 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