1

Is there a way to run a command in puppet master that will bring changes to the hosts right away?

I have used different scripts using crontab to schedule my tasks and it changes whenever I have specified, but I am trying to learn if there is a way I can just hit the command in puppet master and boom! bring changes in the hosts(clients) immediately. Let's say I want to change password in "cofig.properties" file in my 5 hosts. What would be the best way to do it from master without scheduling?

N..
  • 906
  • 7
  • 23
James
  • 193
  • 2
  • 4
  • 15

2 Answers2

2

At work we

  1. push git versioned control repos to a puppetmaster using a jenkins job,
  2. then we use r10k to retrieve the control repo puppet module & hiera dependencies,
  3. then we connect remotely using SSH to each node we want to update to run the relevant "puppet apply" command

It works smoothly.

1

I've solved that problem in my infrastructure by using Puppet for Configuration Management and SaltStack for orchestration.

I have the Puppet Agent apply a SaltStack module to automatically configure each node as a minion of my Salt Master (which is also my Puppet Master), then I just SSH into my master server and tell SaltStack to run the Puppet Agent on nodes that match my criteria.

There are several SaltStack modules on the Puppet Forge.

You could certainly use other tools, such as RunDeck, or even Puppet's own MCollective, but I personally found them to be more complicated to work with.

Dan Bowling
  • 1,205
  • 1
  • 15
  • 41
  • So you are saying there is no particular command you can run on Puppet master that will bring changes to the host right away? – James Jan 14 '16 at 16:50
  • Yes, the Puppet Master does not initiate agent runs, Agents check in with the Puppet Master on their own schedule (manually, via a cron, or as a daemon.) Puppet used to include live management, but that feature was deprecated and is probably already gone. MCollective can reach out and do this for you as I said in the answer, but it's rather complex for only this single use case. It's great, but perhaps not worth the trouble if all you want to do is this. – Dan Bowling Jan 15 '16 at 22:42