Hi everyone,

I'm feeling my way through puppet at this point, so please forgive me if this is puppet 101 stuff.

I've written a basic nagios plugin that's a shell script, and have added a file entry to one of our pre-existing puppet manifests. When I start my local puppet master, connect a client to it and run puppet agent -t, I'm told that puppet 'could not retrieve file metadata for puppet://modules/nagios/scripts/my_script.sh: getaddrinfo: Name or service not known."

I'm not quite sure what that's telling me, but here's my manifest entry for the shell script I wrote (in case you're wondering, /usr/lib is not where the script will live at the end of the day):

file { '/usr/lib/my_script.sh':
ensure  =>  'present',
source  =>  'puppet://modules/nagios/scripts/my_script.sh',
mode    =>  '0755',
owner   =>  '$our_nagios::nagios_user' }  I've checked multiple times and that file exists on the puppet master in the location indicated (taking into account the physical path and the manifest and files directories. ) While I don't expect a slam-dunk solution from what I've listed, would anyone know what I may be missing or where to start? Thanks! edit retag close merge delete 2 Answers Sort by » oldest newest most voted I just ran into this problem too. The mistake is a missing "/". I think you want this instead:  file { '/usr/lib/my_script.sh': ensure => 'present', source => 'puppet:///modules/nagios/scripts/my_script.sh', mode => '0755', owner => '$our_nagios::nagios_user'
}


Notice the source URL needs a slash after ://.

more

Your host has problem resolving the hostname of puppetmaster. Check the value for server in /etc/puppet/puppet.conf . Something like:

server=puppetmaster.example.com


If that is just a local puppetmaster, then add a correct hostname to /etc/hosts on the node server.

more