You are not logged in.

#1 2015-03-31 13:45:29

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Install same package to multiple machines at once

Say I have 4 machines running Arch (which will be 20 in the near future). Let the machines be A, B, C, D. I want to know if it's possible, assuming I have a user on each computer with the same username and password, for me to run pacman -S firefox on machine A and it installs on B, C and D. Same if I run it on machine D, installs to ABC.

I know about pacserve which lets you retrieve packages from other computers on the LAN. I could share the package cache as a NFS (or SSHFS) and make the packages readily available; however, it won't install obviously. Basically I want to keep certain system properties (installed programs, settings, etc) in sync but allow for separate files. If I went to the extreme I could share a root file system over the network and network boot all of the computers, having /home be on the HDD while mounting / OTA.

Any suggestions on how I could go about this?

Offline

#2 2015-03-31 13:53:10

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: Install same package to multiple machines at once

Can't you set up a script sending the command to all the computers over SSH? Another option is a system like puppet.

Keep in mind, I'm no expert and have no experience managing systems like this, so evaluate the options before deciding on one.

Offline

#3 2015-03-31 23:04:57

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Re: Install same package to multiple machines at once

Puppet looks interesting, but it almost looks like I'd need to have the conf files dynamically update. The issue is that, to my knowledge, pacman requires user input; therefore, ssh'ing the command would require me to type Y to install, which I'd need to do however many times.

Is there a way, however, that I could setup a program to watch for "pacman" in my terminal, and if it sees it open an ssh connection to all the computers and send the command along with the input (Y) until the pacman process ends?

Offline

#4 2015-03-31 23:30:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Install same package to multiple machines at once

man pacman

Not a Sysadmin issue. moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2015-04-01 00:16:32

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: Install same package to multiple machines at once

I believe a combination of pacserve + <alpha> would be perfect for you, where

<alpha> = something such as puppet, chef or saltstack.

I tried saltstack last week and I liked it. I wrote a small post in my personal blog about it. If you want to try it, check the wiki.

I'm not sure which of <alpha> would be best for your use case, though. If you have time, try all three and share your experience later on.

Offline

#6 2015-04-01 17:42:59

Maesto
Member
Registered: 2014-06-23
Posts: 6

Re: Install same package to multiple machines at once

You could use pssh. Its a ssh for multiple computers at once.

pacman -S pssh

If you need to do it not only on those 4 PCs I would recomment Ansible http://docs.ansible.com/
The pacman Module would be of use for you. http://docs.ansible.com/pacman_module.html

A Playbook with this content would install "sl" in its latest version (Untested so use with care)

--- 
 - hosts: all
    tasks:
       - name: installing sl
         pacman: name=sl state=latest update_cache=yes

But both is present in community so whatever floats your boat.

Last edited by Maesto (2015-04-09 11:20:11)

Offline

Board footer

Powered by FluxBB