From 9379018d867b1bf013965abac7d49e52039e33a5 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 31 May 2018 18:54:55 -0500 Subject: [PATCH] Reload kubelet unit file if config is changed. --- tasks/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 72d040c..638f7f9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,7 +22,14 @@ regexp: 'Environment="KUBELET_EXTRA_ARGS=' insertafter: '^Environment=' state: present - notify: restart kubelet + register: kubelet_unit_file + +- name: Reload systemd unit if args were changed. + systemd: + state: restarted + daemon_reload: yes + name: kubelet + when: kubelet_unit_file is changed - name: Ensure kubelet is started and enabled at boot. service: