I was looking for a KISS (Keep It Stupidly Simple) approach to manage different boxes. There are programs like Puppet , Ansible,R(?)ex, Chef, Cdist, Cfengine, Cobbler and Fabric that can do the job too. But Salt seems to like Arch and I like Arch so I went for the CLI KISS approach with Salt. Salt will probably be the fastest of them if it has a Arch like KISS style. |
And with it I should be able to install the same on all my boxes - at the same time. All 10000 of them (No joke Salt can handle all of them, it is the most scaleable solution).
But before I take off and land on the moon; lets just get started:
I installed salt from the community repo on my Arch boxes:
Code: Select all
sudo pacman -S salt
Then I went to /etc/salt and edited the minion file in two places:
Code: Select all
master:<IP of the Masterbox>
I had to uncoment it first.
Then I found
Code: Select all
#id:
and replaced it with
Code: Select all
id: 1st_server_to _be_controlled
Here you can provide any name you like (you are simply giving the box an ID, so do not give the same name to other boxes).
Then I started the service on the boxes I wanted to control:
Code: Select all
sudo systemctl start salt-minion
All "minion" boxes are the ones I want to control from my "Master"
On the Master box i started the master service:
Code: Select all
sudo systemctl start salt-master
(On non systemd boxes you may have to start the services differently. like this service salt-minion start)
I cannot hook the boxes together before they have exchanged secure keys and identification so to list them i did a:
Code: Select all
sudo salt-key -L
And voila there under Unaccepted keys the name I had given under "Id:" (see above) turned up.
to accept all keys I did a:
Code: Select all
salt-key -A
I could also have accepted them individually with
Code: Select all
salt-key -a 1st_server_to _be_controlled
Ok I am hooked up now and salt has this nice pacman module so I will be testing that next.....
The pacman module of Salt uses pkg.something (yes lots of commands but I found them easily).
So to find out what needed to be upgraded on all my hooked up boxes I did a:
Code: Select all
sudo salt '*' pkg.list_upgrades
As you can see here viking60-server was fully upgraded but heidi-lap had a few updates.
So time to upgrade all my Archboxes then:
Now I have also added a Centos server to my stack I will probably have to work with config files now - I'll tell you how it goes.....
....
Wow!
I used the pkg syntax to install gmrun on all boxes
Code: Select all
sudo salt '*' pkg.install gmrun
And it did nothing on viking60-server because it is already installed - same thing with heidi-lap. But it did install it on Centos!
I am really beginning to like this thing: It can update a load of computers with different distros- right "out of the box", with dependencies. That is really useful. ... And I have only scratched the surface...
And yes; you can update Windows with it too. The salt-minion can be installed on Windows and be controlled from a Linux master. Windows cannot work as a master.
So if you have 10000 Windows boxes where you want to role out the same config - Linux is your friend.