Ask Your Question
0

couldn't find class

asked 2016-06-17 12:53:57 -0500

Chutki gravatar image

updated 2016-06-21 01:41:09 -0500

Hi,

I have installed pe 2015.3.1 and I am doing testing with sample custom modules

test1.pp
class test::test1{
$enbl =  "running"
}
include test::test1

test2.pp

class test::test2{
include 'test::test1'
service { 'ntpd':
ensure => $test::test1::enbl
}
}
include test::test2

when I run puppet apply -t --noop test2.pp getting below error

Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::test::test1 for master.example.com at /etc/puppetlabs/code/environments/production/modules/test/test2.pp:2:1 on node

part ||

Debug: Facter: fact "memory" has resolved to {
  swap => {
    available => "385.92 MiB",
    available_bytes => 404668416,
    capacity => "81.16%",
    total => "2.00 GiB",
    total_bytes => 2147479552,
    used => "1.62 GiB",
    used_bytes => 1742811136
  },
  system => {
    available => "117.90 MiB",
    available_bytes => 123629568,
    capacity => "93.72%",
    total => "1.83 GiB",
    total_bytes => 1968386048,
    used => "1.72 GiB",
    used_bytes => 1844756480
  }
}.
Debug: Facter: resolving load_average facts.
Debug: Facter: fact "load_averages" has resolved to {
  15m => 0.69,
  1m => 0.85,
  5m => 1.02
}.
Debug: Facter: resolving Xen facts.
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::test::test1 for master.server.com at /etc/puppetlabs/code/environments/production/modules/test/test2.pp:2:1 on node master.server.com

=============================================================================================

/etc/puppetlabs/puppet/puppet.conf

[main]
    certname = master.server.com
    server = master.server.com
    user  = pe-puppet
    group = pe-puppet
    archive_files = true
    archive_file_server = master.server.com
    module_groups = base+pe_only
    environmentpath = /etc/puppetlabs/code/environments
    basemodulepath = /etc/puppetlabs/code/modules
    parser = future

[agent]
    graph = true


[master]
app_management = false
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
reports = puppetdb
certname = master.server.com
always_cache_features = true
edit retag flag offensive close merge delete

Comments

I'm at a loss. PE 2015.3.1 should be equivalent to OS Puppet 4.3.2, which is what I'm running, and I don't have an issue with those class files. Maybe go back to basics - does "puppet apply -t --noop test1.pp" work? Are file permissions correct?

JohnsonEarls gravatar imageJohnsonEarls ( 2016-06-20 08:23:15 -0500 )edit

still I am getting same error. should I update something in site.pp "import classname", how we do for earlier puppet version.

Chutki gravatar imageChutki ( 2016-06-20 11:45:41 -0500 )edit

I have used "inherits" rather than "include", "class test::test2 inherits test::test1" not I am getting "Error: Could not find parent resource type '::test::test1' of type hostclass in production at line 1 on node". I included puppet.conf in the above question part.

Chutki gravatar imageChutki ( 2016-06-21 01:36:43 -0500 )edit

Chutki, what happens when you run "puppet apply -t --noop test1.pp" ?

JohnsonEarls gravatar imageJohnsonEarls ( 2016-06-21 07:32:17 -0500 )edit

I am not getting any error. "Info: Loading facts Info: Loading facts Notice: Compiled catalog for master.server.com in environment production in 0.23 seconds Info: Applying configuration version '1466568341' Notice: Applied catalog in 0.31 seconds" this is the output

Chutki gravatar imageChutki ( 2016-06-21 23:06:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-22 17:26:04 -0500

rnelson0 gravatar image

Can you share the file layout? Even though you're using puppet apply, it will use the autoload method to find classes, and unless test1.pp is located at $modulepath/test/manifests/test.1pp, the autoloader probably cannot find it. But that's just a guess, we need a little more info to confirm or eliminate that possible cause.

edit flag offensive delete link more

Comments

1

I am extremely sorry to trouble you it is a problem with manifests directory, had a typo. I changed the spelling of manifests directory and it worked perfectly. thanks a million.

Chutki gravatar imageChutki ( 2016-06-22 20:21:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-06-17 12:53:57 -0500

Seen: 693 times

Last updated: Jun 22 '16