On Monday, June 17, 2019 at 9:09:52 AM UTC-5, lhu wrote:
>
> Thanks Ben.
>
> Would you know why this wouldn't work? I have the module manifest folder 
> under adhoc/pakg/dan/manifest/
>
> #puppet parser validate init.pp
>
> Warning: Unacceptable location. The name 'adhoc::pkg::dan::init' is 
> unacceptable in file 
> '/opt/puppetlabs/puppet/modules/adhoc/pkg/dan/manifests/init.pp' (file: 
> /opt/puppetlabs/puppet/modules/adhoc/pkg/dan/manifests/init.pp, line: 1, 
> column: 1)
>
>

I don't quite follow what you're trying to do there.  Your module's name is 
"adhoc" (it *cannot* be "adhoc::pkg::dan" because the colon (:) is not 
among the characters allowed in module or class names).  With that being 
the case, the subdirectories of the module layout belong under adhoc/, not 
deeper in the tree.  In particular, a class named adhoc::pkg::dan::init belongs 
in file adhoc/manifests/pkg/dan/init.pp.  I'm not a fan of such a deep 
naming structure, but that would work.

Note also that class names of the form <module name>::init are reserved, 
but if you *do* have a deeper tree then you can have classes whose last 
name segment is "init" at deeper levels.

 

>
> So I assumed with the init.pp file this would work? 
> class adhoc::pkg::dan {
>
>
> }
>
>
No. If /opt/puppetlabs/puppet/modules/adhoc/pkg were in your modulepath 
then you could put the main class of module "dan" in the file you name, i.e.

class dan {
}

That's the only way it works with your placement of the "manifests" 
directory, but DON'T DO THAT.  Setting up a modulepath in containing pairs 
of directories where one is nested inside the other is confusing and 
unnecessary, not to mention that it triggers bugs in some versions of 
Puppet.

 

> I also tried just using the module name prior to the manifest folder but 
> that didn't work as well.
>

If you want a class named adhoc::pkg::dan then it belongs in a file named 
adhoc/manifests/pkg/dan.pp, relative to some folder in your modulepath.  
The init.pp filename is special only for a module main class, and therefore 
only at the top level of the module.


John

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8c31c953-d3c9-4e39-9c28-4d9367ec8129%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to