Can I make Puppet's module-to-file mapping to start searching at the top of the modules tree?
Posted
by John Siracusa
on Server Fault
See other posts from Server Fault
or by John Siracusa
Published on 2010-06-09T16:00:53Z
Indexed on
2010/06/09
16:12 UTC
Read the original article
Hit count: 252
puppet
Consider these two Puppet module files:
# File modules/a/manifests/b/c.pp
class a::b::c {
include b::c
}
# File modules/b/manifests/c.pp
class b::c {
notify { "In b::c": }
}
It seems that when Puppet hits the include b::c
directive in class a::b::c
, it searches for the corresponding *.pp file by looking backwards from the current class and decides that it find the correct file located at ../../b/c.pp
. In other words, it resolves b::c
to the same *.pp file that the include b::c
statement appears in: modules/a/manifests/b/c.pp
I expected it (and would like it) to instead find and load the file modules/b/manifests/c.pp
. Is there a way to make Puppet do this? If not, it seems to me that module names may not contain any other module names anywhere within them, which is a pretty surprising restriction.
© Server Fault or respective owner