Puppet can't find class from imported files

99 views
Skip to first unread message

Anatoliy Lisovskiy

unread,
Jul 16, 2012, 7:50:36 PM7/16/12
to puppet...@googlegroups.com
Hi!
What I am doing wrong?

When I define such a way:
===========================
import "classes/*.pp"

node default{
    include ntp
    include add_admin_accounts

}


node kvm4 inherits default
{
include vm_create
}
===================

it can't find the class from the file imported file.

But when I write such way:

===========================
import "classes/*.pp"

node default{
    include ntp
    include add_admin_accounts
   include vm_create
}

node kvm4 inherits default
{

}
===================

it works fine. What I am doing wrong?


jcbollinger

unread,
Jul 17, 2012, 9:47:35 AM7/17/12
to puppet...@googlegroups.com

Using the 'import' function?

I apologize for the flippancy, but
  1. you haven't given us much to work with, and
  2. instead of using 'import', you really should be putting your classes into modules and relying on the autoloader.
If you want us to have any hope of troubleshooting the immediate problem then please provide the actual error message emitted by puppet and all the classes/*.pp files.  For best results, find a minimal set and minimal content for the imported manifests that still exhibits the problem.


John

Anatoliy Lisovskiy

unread,
Jul 17, 2012, 12:09:18 PM7/17/12
to puppet...@googlegroups.com

Thank you John.

The problem is, when I expand the node ("kvm7" in the example) that inherits description of another node ("default" in the example) puppet can't find the class I add to the node ("vm_create" in the example) during client-server transaction.  But when I add this class to the "default" node it works fine.
"Puppet parser validate" does not complain though in both cases. It is 2.7.18 version, I did not try another one. May be I use wrong syntax, but I can't find in documentation why it should not work: I understand that the node that inherits another node description can be expanded by adding to it's description additional classes, no?

Anatoliy




 

jcbollinger

unread,
Jul 18, 2012, 3:15:40 PM7/18/12
to puppet...@googlegroups.com


On Tuesday, July 17, 2012 11:09:18 AM UTC-5, Anatoliy Lisovskiy (Wavebourn) wrote:

The problem is, when I expand the node ("kvm7" in the example) that inherits description of another node ("default" in the example) puppet can't find the class I add to the node ("vm_create" in the example) during client-server transaction.  But when I add this class to the "default" node it works fine.
"Puppet parser validate" does not complain though in both cases. It is 2.7.18 version, I did not try another one. May be I use wrong syntax, but I can't find in documentation why it should not work: I understand that the node that inherits another node description can be expanded by adding to it's description additional classes, no?

Your expectations appear reasonable.  That's about all I can say at this point.  If you want more then refer to my previous message for a description of the information you will need to provide.


John
 
Reply all
Reply to author
Forward
0 new messages