Skip to content

Commit

Permalink
Restart kubelet only after real kubelet package change
Browse files Browse the repository at this point in the history
  • Loading branch information
Zempashi committed Dec 7, 2023
1 parent d96eaa0 commit 55f2ed0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions roles/packages/tasks/pkg_Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
state: "latest"
allow_change_held_packages: "{{ ansible_check_mode if ansible_version.string is version('2.13', '>=') else omit }}"
when: not(_kube_repo_just_added is changed and ansible_check_mode)
register: _kubelet_installed
register: _kube_pkg_installed

- name: 'Restart kubelet'
service:
name: 'kubelet'
state: restarted
when: _kubelet_installed is changed and not ansible_check_mode
when:
- _kube_pkg_installed is changed
- "kubelet" in kube_package_dict
- not ansible_check_mode

0 comments on commit 55f2ed0

Please sign in to comment.