2

Let's say you have 24 computers. They all have the same Linux or Unix distro on them, with the exact same configuration, but with different users. Is there a way to be able to do the exact same thing on all of them with one command? For example I'm running Lubuntu 14.04 and 14.10 comes out and I want to upgrade all of them while only running sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade once? Is there a software that would allow me to do that?

  • 4
    Puppet, Chef, Ansible, Salt, etc... – jasonwryan Jun 21 '14 at 21:13
  • possibly a duplicate of serverfault.com/questions/17931/… which is a duplicate of others.. – Dani_l Jul 18 '14 at 9:47
  • @jasonwryan, what, no love for CFEngine? – Wildcard Jun 4 '16 at 1:46
  • @Wildcard I just thought I'd mention those people are likely to encounter in real life... :p – jasonwryan Jun 4 '16 at 2:18
  • 1
    @Wildcard don't get your panties in a knot. It was a joke... I wasn't creating an encyclopedic list, just making the point there are plenty of options. – jasonwryan Jun 4 '16 at 2:33
2

I use ClusterSSH. I also use it to administer groups of machines, not just all of them at the same time. That is, I set up shell aliases to open, for example, just the name servers, or just the mail servers, or just the Web servers, etc. Careful! This tool will give you an appreciation for configuration management. There's a nice article on Linux.com.

0

I would write a small BASH script for that manually. A simple for loop can do it for you:

#!/bin/bash

for $host in IPs OF REMOTE HOSTS SPACE SEPARATED
do
   ssh root@$host 'remote command eg. apt-get upgrade'
done
  • That is highly inefficient in large scale deployment, as the commands are done serially. Personally I like psh but that's xcat specific. Basically any concurrent ssh will do and see serverfault.com/questions/17931/… – Dani_l Jul 18 '14 at 9:45
  • @Dani_I what about running them parallel with an additional & ? – psimon Jul 21 '14 at 17:20
  • you'll need to run ssh -n user@host '...' & – Dani_l Jul 21 '14 at 21:37
  • might work, but no easy control of sliding window - how many parallel tunnels would you like to run at any given time? most parallel execution shells allow for easy setting of this value. It can be done in shell (I wrote something similar years ago) but really not worth the headache. You have to monitor the connections, and start a new one for each one that finishes... – Dani_l Jul 21 '14 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.