From 8024449e2b4d983bf9f26c8c73a571974837f4ab Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 19 Jul 2020 15:21:09 +0100 Subject: [PATCH] salt/minion: only restart salt-minion on config/pkg change Signed-off-by: Joe Groocock --- states/salt/minion/init.sls | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/states/salt/minion/init.sls b/states/salt/minion/init.sls index 0a0fb4f..c2d6092 100644 --- a/states/salt/minion/init.sls +++ b/states/salt/minion/init.sls @@ -11,10 +11,10 @@ salt-minion: restart-salt-minion: cmd.run: - - name: "sleep 10 && systemctl restart salt-minion --no-block" + - name: sleep 10 && systemctl restart salt-minion - bg: true - order: last - - watch: + - onchanges: - pkg: salt-minion - file: /etc/salt/minion - require: @@ -34,6 +34,7 @@ restart-salt-minion: check-minion-config: cmd.run: - - name: sudo salt-call --local --skip-grains test.ping - - watch: + - name: sudo salt-call --local --skip-grains test.true + - onchanges: + - pkg: salt-minion - file: /etc/salt/minion