Ask Your Question

How do I get Puppet Master to run a manifest against a Puppet Agent server?

asked 2016-01-19 20:39:22 -0600

Conventional gravatar image

updated 2016-01-19 20:47:39 -0600

I installed Puppet Agent on a CentOS 7 server. I installed Puppet Master on a different CentOS 7 server. I'm using the free version of Puppet. The Puppet Agent server requested a certificate. I signed it on the Puppet Master server. There is no software firewall on either server. There is no firewall between the servers. I temporarily enabled port 8140 with SSHD. I used SSH to verify port 8140 was open. I then reverted SSHD to only listen on port 22. Port 8140 wasn't blocked. nslookup on the IP addresses and ping against the domain names shows that both servers have correct networking information about the other server. These are new servers. Puppet has never worked on them before. I created a simple manifest. I applied it to the Puppet Master server locally. It worked without errors. I then tried to apply it to the Puppet Agent server. It didn't work.

From the Puppet Master server, I ran this:

puppet agent neat.pp --server hostNameOfPuppetAgentServer --verbose

There were no errors on the Puppet Master server after I pressed enter. There was no output at all. This produced no logs on the Puppet Agent server. There was no evidence it worked on the Puppet Agent server. I checked, and the effects were not performed.

On the Puppet Master server I ran this:

puppet agent --server hostNameOfPuppetAgentServer --test

The results included "Connection refused -- connect (2)." What is wrong? I expect the manifest to work on a Puppet Agent node.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2016-01-20 16:23:56 -0600

lavaman gravatar image

You do not run things on agents from the master. You start the agent on a system, and it periodically checks in with the master. You can also run the agent manually using puppet agent -t on the system running the agent. You'll also need some way to tell the master that the agent in question should use the code in your .pp file. This can be done through site.pp or nodes.pp on the master.

edit flag offensive delete link more

answered 2016-01-20 17:01:28 -0600

hesco gravatar image

updated 2016-01-20 17:02:29 -0600

What lavaman says is generally correct, however there are exceptions. In days of old, there was a mechanism for 'kick'ing an agent from the master. But that was before version 0.27. Kick had long since been deprecated by v3.0.x. These days we can use a tool called mcollective to do the same thing on an agent from the master, or with some scripting, it is possible to do some level of orchestration among multiple interdependent-nodes using mco. And again, with the advent of puppet 2015.3 there is a new orchestrator in town which apparently will do mco one better (caveat: I have not yet used the orchestrator, only seen presentations about it).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-01-19 20:39:22 -0600

Seen: 179 times

Last updated: Jan 20 '16