'How to upgrade salt-minion service on Windows Servers from Salt-master without getting an error
So I've a single master which have around 300+ minions connected to it. With the latest upgrade 3004.1; I want to upgrade all of them. They are a mixture of Linux and Windows servers. I'm able to upgrade the Linux servers flawlessly from the salt-master using a state file as suggested by the FAQ section documentation of Salt which can be found here
However, when I'm trying to do the same thing for Windows, the upgrade happens in the background without any issues but I get an error as Minion did not return. [No Response]. Below is the code which is installing the latest package on the Windows Minion.:
Upgrade Salt Minion:
pkg.installed:
- name: salt-minion
- version: 3004.1
- order: last
Enable Salt Minion:
service.enabled:
- name: salt-minion
- require:
- pkg: Upgrade Salt Minion
Restart Salt Minion:
cmd.run:
{%- if grains['kernel'] == 'Windows' %}
- name: 'C:\salt\salt-call.bat service.restart salt-minion'
{%- else %}
- name: 'salt-call service.restart salt-minion'
{%- endif %}
- bg: True
- onchanges:
- pkg: Upgrade Salt Minion
As we can see above, it's a fairly simple state file to install the minion service. I was thinking if there's anyway wherein we can put an explicit sleep in the install command so that when the response is returned, I can see Green output with proper results.
Note: I can still re-run the state file again and it will give me the proper result on the second time as it will skip the ones that's already upgraded. But I think there should be a more correct way of doing this via Salt.
Anyone else have upgraded their Windows minions via Master. Please share your thoughts.
2nd Qts: Since this is kinda related so asking it here if anyone else have found a solution? I'm unable to install the latest Salt package on Windows Server 2008? Has anyone else faced a similar problem? I know the server is quite and at EOL but for some unavoidable circumstances it will take time for the upgrade to happen. Suggestions on this please:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

