1 parent 7924b24 commit 5d8a917Copy full SHA for 5d8a917
1 file changed
ansible/snap-microk8s/snap-update.yaml
@@ -16,6 +16,23 @@
16
state: present
17
classic: true
18
channel: '{{ microk8s_version }}'
19
+ register: snap_update_result
20
21
- name: Restart each VM
- 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
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