From 32fbd498cff70c13bd06590cc3cabb749d75b508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sat, 27 Jul 2024 11:46:39 +0300 Subject: [PATCH] Fix typo --- ansible-kubernetes.yml | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/ansible-kubernetes.yml b/ansible-kubernetes.yml index 306c721..e2a6b19 100644 --- a/ansible-kubernetes.yml +++ b/ansible-kubernetes.yml @@ -2,7 +2,7 @@ - name: Reconfigure Kubernetes nodes hosts: kubernetes vars: - KUBERNETES_VERSION: v1.27.16 + KUBERNETES_VERSION: v1.28.12 tasks: - name: Remove APT packages ansible.builtin.apt: @@ -13,23 +13,33 @@ - kubeadm - kubectl - - name: Download kubectl + - 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' }}/kubectl" - dest: /usr/bin/kubectl + url: "https://cdn.dl.k8s.io/release/{{ KUBERNETES_VERSION }}/bin/linux/{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}/{{ item }}" + dest: "/usr/bin/{{ item }}-{{ KUBERNETES_VERSION }}" mode: '0755' + loop: + - kubelet + - kubectl + - kubeadm - - name: Download kubeadm - ansible.builtin.get_url: - url: "https://cdn.dl.k8s.io/release/{{ KUBERNETES_VERSION }}/bin/linux/{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}/kubeadm" - dest: /usr/bin/kubeadm - mode: '0755' + - name: Create symlinks for kubectl, kubeadm, kubelet + ansible.builtin.file: + src: "/usr/bin/{{ item }}-{{ KUBERNETES_VERSION }}" + dest: "/usr/bin/{{ item }}" + state: link + loop: + - kubelet + - kubectl + - kubeadm + register: kubelet - - name: Download kubelet - ansible.builtin.get_url: - url: "https://cdn.dl.k8s.io/release/{{ KUBERNETES_VERSION }}/bin/linux/{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}/kubelet" - dest: /usr/bin/kubelet - mode: '0755' + - name: Restart Kubelet + service: + name: kubelet + enabled: true + state: restarted + when: kubelet.changed - name: Create /etc/systemd/system/kubelet.service ansible.builtin.copy: