Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class

64 views
Skip to first unread message

jyotir bhandari

unread,
Jan 19, 2014, 10:12:12 AM1/19/14
to puppet...@googlegroups.com
Hi

I am trying to install package, which i was able to install if I kept the pp file in manifests and then importing via site.pp, but not working when i put it in module directory and then including class in nodes.pp

On puppet master


[root@server puppet]# tree
.
|-- auth.conf
|-- fileserver.conf
|-- manifests
|   |-- nodes.pp
|   `-- site.pp
|-- modules
|   `-- packages
|       `-- manifests
|           `-- nmap.pp
`-- puppet.conf


site.pp

import 'nodes.pp'

nodes.pp

node 'server.puppet.com' {
    }

node 'client1.puppet.com' {
    }

node 'client2.puppet.com' {
    include nmap
    }


nmap.pp


class nmap {
case $operatingsystem {
        centos, redhat: {
        package { "nmap":
        ensure => installed,
        }
      }
        debian, ubuntu: {
        package { "nmap":
        ensure => installed,
        }
      }
     }
    }



error on puppet client

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class nmap for client2.puppet.com on node client2.puppet.com
Warning: Not using cache on failed catalogr
Error: Could not retrieve catalog; skipping run


Jyotir

Jose Luis Ledesma

unread,
Jan 19, 2014, 10:13:29 AM1/19/14
to puppet...@googlegroups.com
Hi,

Nmap.pp should be called init.pp

Regards,

Jose Luis Ledesma

unread,
Jan 19, 2014, 10:15:30 AM1/19/14
to puppet...@googlegroups.com
Ah! And the directory packages should be called nmap (the same name than the class, is how autoloader find it)

Regards,

jyotir bhandari

unread,
Jan 19, 2014, 10:23:19 AM1/19/14
to puppet...@googlegroups.com
Hi Jose,

Thanks, that helped and worked for me.

Jyotir
Reply all
Reply to author
Forward
0 new messages