Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puppet agent can't find server

Tags:

I'm new to puppet, but picking it up quickly. Today, I'm running into an issue when trying to run the following:

$ puppet agent --no-daemonize --verbose --onetime  **err: Could not request certificate: getaddrinfo: Name or service not known Exiting; failed to retrieve certificate and waitforcert is disabled** 

It would appear the agent doesn't know what server to connect to. I could just specify --server on the command line, but that will be of no use to me when this runs as a daemon in production, so instead, I specify the server name in /etc/puppet/puppet.conf like so:

[main]     server = puppet.<my domain> 

I do have a DNS entry for puppet.<my domain> and if I dig puppet.<my domain>, I see that the name resolves correctly.

All puppet documentation I have read states that the agent tries to connect to a puppet master at puppet by default and your options are host file trickery or do the right thing, create a CNAME in DNS, and edit the puppet.conf accordingly, which I have done.

So what am I missing? Any help is greatly appreciated!

like image 774
Kent Rancourt Avatar asked May 23 '12 23:05

Kent Rancourt


People also ask

How do I enable Puppet agent?

Disable and re-enable Puppet runs To disable the agent, run: sudo puppet agent --disable "<MESSAGE>" To enable the agent, run: sudo puppet agent --enable.

What is the server name in Puppet?

The Puppet Server service name is puppetserver . To start and stop the service, use commands such as service puppetserver restart , service puppetserver status for your OS.

How do I restart the Puppet agent on Windows?

To stop and restart the service, run the following commands: sc stop puppet sc start puppet. To change the arguments used when triggering a Puppet agent run, add flags to the command: sc start puppet --debug --logdest eventlog.


2 Answers

D'oh! Need to sudo to do this! Then everything works.

like image 151
Kent Rancourt Avatar answered Oct 14 '22 16:10

Kent Rancourt


I had to use the --server flag:

sudo puppet agent --server=puppet.example.org 
like image 29
bmaupin Avatar answered Oct 14 '22 16:10

bmaupin