Reputation: 59
I am getting error in puppet agent test:
parallels@puppet-server:~$ puppet agent -t
Error: Could not request certificate: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Exiting; failed to retrieve certificate and waitforcert is disabled
parallels@puppet-server:~$ sudo puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Info: Retrieving pluginfacts
Error: /File[/var/cache/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Error: /File[/var/cache/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Info: Retrieving plugin
Error: /File[/var/cache/puppet/lib]: Failed to generate additional resources using 'eval_generate': Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Error: /File[/var/cache/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Error: Could not retrieve catalog from remote server: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
MASTER CONF FILE: /etc/puppet/puppet.conf
:
[main]
ssldir = /var/lib/puppet/ssl
logdir = /var/log/puppet
localconfig = $vardir/localconfig
classfile = $vardir/classes.txt
[master]
environment = production
server = puppet-server
ca_server = puppet-server
vardir = /var/lib/puppet
cadir = /var/lib/puppet/ssl/ca
dns_alt_names = puppet
MASTER /etc/hosts
:
127.0.0.1 localhost
127.0.1.1 parallels-Parallels-Virtual-Platform
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.64.14 puppet-server
192.168.64.16 node-01
AGENT CONF FILE: /etc/puppet/puppet.conf
:
[main]
ssldir = /var/lib/puppet/ssl
vardir = /var/lib/puppet
cadir = /var/lib/puppet/ssl/ca
dns_alt_names = puppet
[agent]
server=192.168.64.14
ca_server=192.168.64.14
AGENT /etc/hosts
:
127.0.0.1 localhost
127.0.1.1 parallels-Parallels-Virtual-Platform
192.168.64.14 puppet-server
192.168.64.16 node-01
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Upvotes: 1
Views: 14510
Reputation: 1
In my VM, the IP address changed, so changing the /etc/hosts file by adding the following at the end solved the issue.
192.168.0.7 puppet-master puppet-master.local
192.168.0.8 puppet-client puppet-client.local
192.168.0.7 puppet puppet.local
Here puppet-master is the name of the puppet server system and puppet-client is the hostname of puppet-agent system
Upvotes: 0
Reputation: 171
If you run puppet agent -t
as a non-root user, Puppet creates a configuration folder structure under ~/.puppetlabs and ignores /etc/puppetlabs/puppet/* (source: https://puppet.com/docs/puppet/latest/dirs_confdir.html, you can pick your version from the drop-down if you're not using the latest)
If you can, try running as root (sudo -i
first, then run puppet agent -t
) or try with sudo (which does not work for me, but may for you).
Upvotes: 1
Reputation: 2970
As the error message says:
Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)
It cannot find the host puppet
.
If you add that to /etc/hosts
on your client and server, it should work:
192.168.64.14 puppet
Upvotes: 1