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

37 lines
1.1 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.
shell: "curl -fsSL https://pkgs.k8s.io/core:/{{ kubernetes_apt_release_channel }}:/v{{ kubernetes_version }}/deb/Release.key | gpg --dearmor -o {{ kubernetes_apt_keyring_file }}"
args:
creates: "{{ kubernetes_apt_keyring_file }}"
- name: Be sure deprecated Kubernetes repository is absent.
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:
repo: "{{ kubernetes_apt_repository_pkgs_k8s_io }}"
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