diff --git a/ansible/playbooks/upgrade_k3s_aerodrome.yml b/ansible/playbooks/upgrade_k3s_aerodrome.yml index 3e4ca11..4826452 100644 --- a/ansible/playbooks/upgrade_k3s_aerodrome.yml +++ b/ansible/playbooks/upgrade_k3s_aerodrome.yml @@ -16,32 +16,35 @@ ansible.builtin.debug: msg: "Upgrading {{ inventory_hostname }} from {{ pre_k3s_ver.stdout_lines[0] }} to {{ target_k3s_version }}" - - name: Download and execute K3s binary upgrade + - name: Download target K3s release binary and replace executable ansible.builtin.shell: | - curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION={{ target_k3s_version }} sh - - register: k3s_upgrade_cmd + set -e + ENCODED_VER=$(echo "{{ target_k3s_version }}" | sed 's/+/%2B/g') + curl -sfL "https://github.com/k3s-io/k3s/releases/download/${ENCODED_VER}/k3s-arm64" -o /usr/local/bin/k3s.new + chmod +x /usr/local/bin/k3s.new + mv /usr/local/bin/k3s.new /usr/local/bin/k3s + register: k3s_download - - name: Ensure K3s systemd unit is active + - name: Restart K3s systemd service ansible.builtin.systemd: name: k3s - state: started - enabled: true + state: restarted - - name: Wait for local K3s service to be active + - name: Wait for K3s systemd unit to report active ansible.builtin.command: systemctl is-active k3s register: k3s_active until: k3s_active.stdout == "active" - retries: 15 - delay: 5 + retries: 20 + delay: 4 changed_when: false - - name: Wait for node to report Ready in cluster + - name: Wait for upgraded node to report Ready in Kubernetes ansible.builtin.command: kubectl get node {{ inventory_hostname }} -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' delegate_to: sninfr2lnxctl01 register: node_ready until: node_ready.stdout == "True" - retries: 20 - delay: 6 + retries: 30 + delay: 5 changed_when: false - name: Query post-upgrade K3s version diff --git a/snarfcode_update.bundle b/snarfcode_update.bundle index 84d1750..0e4b0fe 100644 Binary files a/snarfcode_update.bundle and b/snarfcode_update.bundle differ