manage cri-o on kubernetes nodes
This commit is contained in:
parent
8529e7c0cc
commit
7958c0c7a9
@ -33,6 +33,7 @@
|
||||
hosts: kubernetes
|
||||
vars:
|
||||
KUBERNETES_VERSION: v1.30.3
|
||||
CRIO_VERSION: v1.30
|
||||
IP: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
|
||||
tasks:
|
||||
- name: Remove APT packages
|
||||
@ -44,6 +45,32 @@
|
||||
- kubeadm
|
||||
- kubectl
|
||||
|
||||
- name: Delete old repos
|
||||
ansible.builtin.shell: "rm /etc/apt/sources.list.d/kubernetes.list"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Delete old repos
|
||||
ansible.builtin.shell: "rm -rf /etc/apt/sources.list.d/devel*"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Add cri-o apt signing key
|
||||
ansible.builtin.apt_key:
|
||||
url: "https://pkgs.k8s.io/addons:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/Release.key"
|
||||
state: present
|
||||
|
||||
- name: Add cri-o apt repo
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb https://pkgs.k8s.io/addons:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/ /"
|
||||
state: present
|
||||
filename: crio
|
||||
|
||||
- name: Install cri-o
|
||||
ansible.builtin.apt:
|
||||
name: cri-o
|
||||
state: latest
|
||||
|
||||
- name: Download kubectl, kubeadm, kubelet
|
||||
ansible.builtin.get_url:
|
||||
url: "https://cdn.dl.k8s.io/release/{{ KUBERNETES_VERSION }}/bin/linux/{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}/{{ item }}"
|
||||
|
Loading…
Reference in New Issue
Block a user