Skip to content

Commit 5d8a917

Browse files
authored
[14-09-2025] Feat: Add verification for version upgrade (#21)
Feat: Add verification for version upgrade
1 parent 7924b24 commit 5d8a917

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

ansible/snap-microk8s/snap-update.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@
1616
state: present
1717
classic: true
1818
channel: '{{ microk8s_version }}'
19+
register: snap_update_result
1920

2021
- name: Restart each VM
21-
ansible.builtin.reboot:
22+
ansible.builtin.reboot:
23+
when: snap_update_result.changed
24+
25+
- name: Ping all hosts after reboot
26+
ansible.builtin.ping:
27+
register: ping_after_reboot
28+
when: snap_update_result.changed
29+
30+
- name: Check the k8s version
31+
ansible.builtin.command: microk8s kubectl version
32+
register: k8s_version
33+
when: snap_update_result
34+
35+
- name: Print the k8s version
36+
ansible.builtin.debug:
37+
var: k8s_version.stdout_lines
38+
when: k8s_version

0 commit comments

Comments
 (0)