Puppet 3.3.1 [standalone mode]: could not find class

147 views
Skip to first unread message

ulrich igor ngouagna kouete

unread,
Nov 7, 2013, 5:42:06 AM11/7/13
to puppet...@googlegroups.com
Hi,

I'm new on  puppet and I'm having an issue with "puppet apply" command in a standalone mode.

a tree command on my project folder gives: 

test
└── manifests
    ├── init.pp
    ├── preparehost
    │   └── params.pp
    └── preparehost.pp


#cat /test/manifests/ini.pp

notify{"here we go":   
include preparehost

#cat /test/manifests/ preparehost.pp

class test::preparehost inherits test::preparehost::params {  
  #curl
  notify{$myname:
  } -> 
  package{'curl':
    ensure => installed
  }
  
}

#cat /test/manifests/params.pp

class test::preparehost::params{
  $myname = "ulky"
}


When I run the command 

# puppet apply /test/manifests/init.pp

I get the folowwings:

Error: Could not find class test::preparehost for clouderatest-vm on node clouderatest-vm
Error: Could not find class test::preparehost for clouderatest-vm on node clouderatest-vm

Any idea??

Thanks


ulrich igor ngouagna kouete

unread,
Nov 7, 2013, 10:15:33 AM11/7/13
to puppet...@googlegroups.com
Nobody to help?? :(

Chad Huneycutt

unread,
Nov 7, 2013, 11:05:59 AM11/7/13
to puppet...@googlegroups.com
I believe what you are trying to do is create a module named 'test'.
In order to know about your module, you need to provide the
'modulepath' parameter to puppet.

There are a couple other things you probably want to do. In your
tests/manifests/init.pp, you should wrap everything in a class
declaration, so:

class test {
notify{"here we go": }
include preparehost
}

Then create a file called 'site.pp' or something at the same level of
the filesystem as your 'test' directory. Make that file look like:

include test

Then invoke puppet as such

puppet apply --modulepath . site.pp

puppet should find your test module and load the classes automatically.

Hope that help,
Chad
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/1467f7ca-0fd6-4011-a40c-3050e0aeb9bd%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



--
Chad M. Huneycutt
Reply all
Reply to author
Forward
0 new messages