参考资料:https://docs.saltstack.com/en/latest/topics/windows/windows-package-manager.html#install-a-package
说明:当前minion是32位windows,minion所属group为test_server
1, 更新资源库
salt-run winrepo.update_git_repos
2, vim /srv/salt/win/repo/salt-winrepo.git/firefox_x86.sls
firefox_x86:
'33.1.1':
full_name: 'Mozilla Firefox 33.1.1 (x86 zh-CN)'
installer: 'http://xxxxx/server/Firefox_Setup_33.1.1.exe'
install_flags: '/s'
uninstaller: '%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe'
uninstall_flags: '/S'
msiexec: False
locale: zh_CN
reboot: False
3, 生成msgpack序列化
salt-run winrepo.genrepo
4, 查看自定义版本:
salt -N test_server pkg.available_version firefox_x86
5,安装:
'salt -N test_server pkg.install 'firefox_x86' version=33.1.1
unicomrecharge_server1.ctu.com:
----------
Mozilla Firefox 33.1.1 (x86 zh-CN):
----------
new:
33.1.1
old:
Mozilla Maintenance Service:
----------
new:
33.1.1
old:
unicomrecharge_server2.ctu.com:
----------
Mozilla Firefox 33.1.1 (x86 zh-CN):
----------
new:
33.1.1
old:
Mozilla Maintenance Service:
----------
new:
33.1.1
old:
如果已经安装了
# salt -N test_server pkg.install ‘firefox_x86’ version=33.1.1
unicomrecharge_server1.ctu.com:
———-
unicomrecharge_server2.ctu.com:
———-
6,卸载:
salt -N test_server pkg.remove firefox_x86