I've found an apparent bug in the puppet parser.

If you are using 'import' to include the contents of a subdirectory, like this:

import 'foo/*.pp'

and then you create a new module 'foo', suddenly the import statement silently 
stops working.  This means that any node definitions in the manifests that 
should have been included are not present, and those nodes fall back to the 
default node.  The 'foo' module can be completely minimal, just a 'class foo { 
}' in the init.pp is enough to break the import.

Now, in our case, our default node closes the firewall.  When we productionised 
a new module called 'oracle', all of the node definitions imported from 
oracle/*.pp suddenly stopped working, and so all the production oracle servers 
fell back to the default node definition, and closed their firewalls...  Insert 
the sound of the brown stuff hitting the fan...

I have successfully duplicated this, and logged it as a bug on the Puppet bug 
tracker.  A workaround seems to be to add a './' prefix to the imported 
directory name:

import './foo/*.pp'

which has the same effect, but is not broken by having a 'foo' module present.

I've tried to delve through the parser code to track this one down, but my Ruby 
skills are not as good as my Perl skills, and I've not managed to identify the 
reason.  Possibly the parser creates a new class for the imported directory?

I'd be interested in hearing if anyone else has experienced this, or if this 
clears up odd behaviour you're experiencing on your system.  Also, if you also 
have the problem, please go to the bug tracker and give this a +1 to help it 
get higher priority on the fix list...

Steve


Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.ship...@auckland.ac.nz<mailto:s.ship...@auckland.ac.nz>
Ph: +64 9 373 7599 ext 86487

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to