0

I have a setup of a bunch of machines (Ubuntu servers) which are geographically separated and are used for developing the same code-base. Sometimes I need to install packages on the machine from my site and then ssh to all of the others and install the packages there too. I would like to automate this and if I've installed a new package on my machine (master) it will be automatically installed to the others. The process need not to be instant, it can be done over the night.

For this I've tried to use puppet with the 'package' resource, but this means I would need to add another entry for each newly installed package. Isn't there any other approach (like maybe checking the installed packages and insert a new entry with the new package)?

I've also looked at the apt module for puppet but couldn't find anything related directly to this.

030
  • 5,731
  • 12
  • 61
  • 107
emmerich
  • 53
  • 5
  • Possible duplicate of [Upgrading multiple Debian servers at once](http://serverfault.com/questions/343013/upgrading-multiple-debian-servers-at-once) – 030 Nov 28 '16 at 13:19

1 Answers1

2

There is no way of doing this that I'm aware.

I might suggest that you're approaching this with the wrong attitude somewhat.

The idea behind Puppet is not to do a bunch of manual work on a single server, than have that config replicated to other servers.

The idea is that you declare how you want your servers to look using Puppet, and then Puppet makes all the servers look that way.

I would recommend stopping installing packages manually altogether, where it can be avoided. Simply update your Puppet manifests when you want a new package to be installed.

Alongside that, make sure your manifests are being stored in version control like Git, so that you can track the changes as they were made.

jaxxstorm
  • 606
  • 6
  • 10
  • That's an interesting idea Frap! :) It might be that I've never thought of it because I always had in mind that the "main" server is also the puppet master and not a puppet node. Can I apply the manifests on the master too by calling 'puppet apply'? – emmerich Nov 21 '16 at 14:09
  • It depends on which model you're using. If you're using the client server model, you'd run `puppet agent -t` and control your master with the puppet agent as well. The agent will check in to the master like any other agent. It sounds like you're using the masterless model, which makes use of `puppet apply` - in this case you don't necessarily _have_ a master. – jaxxstorm Nov 21 '16 at 14:14
  • I'm actually using a client server model. So my understanding is that I should use then the puppet agent -t on the master as well. For the master to act also as an agent I sould add the [agent] entry in puppet.conf I guess – emmerich Nov 21 '16 at 14:31
  • Yes that's exactly right. – jaxxstorm Nov 21 '16 at 14:56