[root@pupclient ~]# puppet agent --test
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class sudo for pupclient on node pupclient
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
puppet.conf file on the client is pointed to the server which I named as puppet and which the client is able to resolve in DNS.
[root@pupclient ~]# cat /etc/puppet/puppet.conf
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
server=puppet
[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
[root@puppet manifests]# pwd
/etc/puppet/manifests
[root@puppet manifests]# cat site.pp
import 'nodes.pp'
$puppetserver = 'puppet'
[root@puppet manifests]# cat nodes.pp
node 'pupclient' {
include sudo
package {'firefox': ensure => present}
}
[root@puppet manifests]# pwd
/etc/puppet/modules/sudo/manifests
[root@puppet manifests]# ls -l
total 4
-rw-r--r-- 1 root root 327 Jan 19 23:15 init.pp
[root@puppet manifests]# cat init.pp
class sudo {
package { sudo:
ensure => present,
}
if $operatingsystem == "Ubuntu" {
package { "sudo-ldap":
ensure => present,
require => Package["sudo],
}
}
file { "/etc/sudoers":
owner => root,
group => root,
mode => 0440,
source => "puppet://$puppetserver/modules/sudo/etc/sudoers",
require => Package["sudo"],
}
}
Is this error result of a syntax issue or something else?