When you are in a situation where you need your configuration managment to be client/server saltstack is a good choice instead of ansible.
All the following commands if run are run from the salt master.
apt-get install -y python-software-properties
add-apt-repository ppa:saltstack/salt -y
apt-get update
apt-get install -y salt-master
service salt-master restart
This will get a SaltStack master server up and running. From this point you can configure it any way you want.
See the SaltStack example for more configuration options.
Accept All
salt-key –A
Delete All
salt-key –D
Once a minion is accepted you should refresh its package list
salt '*' pkg.refresh_db
Review http://docs.saltstack.com/en/latest/topics/targeting/grains.html
Minion config file: C:\salt\conf\minion
Find the section that looks like the following and add your new role.
grains:
roles:
- IISStaging
That could become the following if we added a new role called PowerShellExample.
grains:
roles:
- IISStaging
- PowerShellExample
After saving restart the salt minion with
sudo salt-minion -d
See http://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#module-salt.states.module
See http://www.saltstat.es/posts/role-infrastructure.html
Run command on all minions
salt '*' test.ping
Run command on only ubuntu servers
salt -C 'G@os:Ubuntu' test.ping
Run command on only IIS servers
salt -C 'G@roles:IISStaging' test.ping
salt '*' state.highstate
salt '*' state.highstate env=base
The top.sls file can have multiple environments. By default this example only has 1 called base.
salt -C 'G@roles:NginxStaging' state.highstate
salt-run winrepo.update_git_repos
salt-run winrepo.genrepo
salt '*' pkg.refresh_db
Call the following from a minion
salt-call -l debug state.highstate
or
salt-call state.show_highstate
Upload states to master server in the folder
/srv/salt
When uploading the files use an scp client (filezille, or whatever).
Upload the full contents of the local folder /salt/*.