I created two fresh VMs: one for the puppet-master (sbe-puppet) and one for my node (sbe1).
On my master I have a file testdefine.pp with this content:
class testdefine {
define testdefine ($data) {
file {"$title":
ensure => file,
content => $data,
}
}
testdefine {'/var/tmp/puppetfile1':
data => "The name of the file is puppetfile1 and it is created by puppet\$
}
testdefine {'/var/tmp/puppetfile2':
data => "The name of the file is puppetfile2 and it is created by puppet\$
}
testdefine {'/var/tmp/puppetfile3':
data => "The name of the file is puppetfile3 and it is created by puppet\$
}
}
and a file node.pp with this content:
import "testdefine"
node 'sbe-puppet.mydomain.net'{
include testdefine
}
node 'sbe1.mydomain.net' {
include testdefine
}
After running sudo puppet apply node.pp (without errors) these 3 testfiles only exist on my master, but don't appear on my node.
sudo puppet cert list -all lists my node with a +.
And puppet agent --configprint server (on my node) shows the correct DNS name of my master.
But when I run $ puppet agent --test on my node I get:
Error: Could not request certificate: getaddrinfo: Name or service not known
Exiting; failed to retrieve certificate and waitforcert is disabled
I don't know what's wrong here, because my master already accepted the nodes cert request?!
Can anyone help to get this simple "hello world"-configuration to work?
Additional question: I have master and node in a virtual network (using MS Azure) and I want to only open ports 80/443 for my node and only 22 for my master - will this work with puppet?