Install the Windows Client
or from the file list:
https://repo.saltstack.com/windows/
NB: minion config is here by default:
C:\salt\conf\minion
https://repo.saltstack.com/windows/
NB: minion config is here by default:
C:\salt\conf\minion
On the Server
Create the 'top' file:- Create a 'top.sls' file:
vi /srv/salt/top.sls - Add in the declarations the environment:
base:
'*':
- global
- salt.minion 'os:Windows':
- match: grain
- windows
This tells salt that for the environment called base all minions will have state files /srv/salt/global.sls and /srv/salt/salt/minion.sls applied to them.
All systems that match the 'grain' of Windows all Minions will have the state file /srv/salt/windows.sls or /srv/salt/windows/init.sls applied to them.
Package Manager
See also the official documentation 'Windows Package Manager'- Initialize the repository on your Salt master:
salt-run winrepo.update_git_repos - Run pkg.refresh_db on each of your Windows minions to synchronize the package repository:
salt -G 'os:windows' pkg.refresh_db - Show Installed packages:
salt -G 'os:windows' pkg.list_pkgs
Use Chocolatey in a State
vi /srv/salt/windows.sls
chocolatey:module.run:
- name: chocolatey.bootstrap
firefox:
module.run:
- unless: # command to check if firefox is already installed
- name: chocolatey.install
- m_name: firefox
- require:
- module: chocolatey
No comments:
Post a Comment