Prefix: I searched this out, but the fact that there are any number of things that can cause this problem, I have been unable to find a solution to this particular case.
I have a puppet master (3.0.2-1; RHEL6) and the /etc/puppet/manifests/site.pp file contains the following:
import 'nodes/nodes.pp'
$puppetserver = 'puppet.example.dom'
Naturally, the server domain is not what is in use, but has been changed to protect the innocent.
The nodes/nodes.pp file contains:
node 'agent1.example.dom' {
include users,
}
The users class is under /etc/puppet/modules/users. The manifests/init.pp file contains:
class users {
group { 'admins':
ensure => 'present',
gid => '501',
}
user { 'user1':
ensure => 'present',
uid => '10000',
gid => '501',
home => '/home/user1',
password_max_age => '60',
password_min_age => '1',
shell => '/bin/bash',
}
}
If I remove the "include users", line from the nodes.pp file the catalog is applied:
Info: Retrieving plugin
Info: Caching catalog for agent1.example.dom
Info: Applying configuration version '1357858753'
Notice: Finished catalog run in 0.02 seconds
However, when I include it the following error appears:
[root@agent1 ~]# puppet agent --test --noop
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not
parse for environment production: Syntax error at '}' at
/etc/puppet/manifests/nodes/nodes.pp:3 on node agent1.example.dom
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
This makes me think I have a syntax error in the init.pp file, but I can't figure out what it would be. Maybe I don't have this properly configured or I'm linking the various parts incorrectly?
I've tried without the comma in the nodes.pp file as well as with. I've also tried it without a comma on the last row of the users init.pp file as well as with. I've tried with an empty line between the group definition and the user definition. I get the same result regardless of whatever minor change I make.
I've also tried putting the node definition directly into the site.pp file but the same error occurs. Just from a different location than previously (site.pp vs nodes/nodes.pp).
Connectivity to the server has been verified using telnet from agent1 to port 8140 on the puppet master.
Any ideas? The agent is also v3.0.2-1, but is RHEL5. I haven't tested a RHEL6 agent yet.
EDIT: I ran the test with the --debug option. The output is here: http://pastebin.com/zNs5DvCD
EDIT 2:
I didn't declare the class/module before attempting this. I did so with puppet apply /etc/puppet/modules/users/manifests/users.pp
(after changing the filename). This now gives me the following error:
[root@agent1 puppet]# puppet agent --test --noop
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not
find class users for agent1 on node agent1
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
So, something changed. The syntax error is gone, but the class can't be found.