On 5/21/14, 11:45 AM, Andre Nathan wrote:
> Hello
> 
> I have a fairly large repository (~100 modules, ~50 classes, ~200
> nodes). It is currently organized like this:
> 
> modules/
>     apache2/
>       manifests/
>       files/
>       templates/
>     iptables/
>       manifests/
>       files/
>       templates/
>     postfix/
>       manifests/
>       files/
>       templates/
>     ...
> manifests/
>     classes/
>         webserver.pp
>         webserver/
>             apache2.pp
>             iptables.pp
>         mta/
>             postfix.pp
>             iptables.pp
>         ...
>     nodes/
>         webserver.pp
>         webserver/
>             web1.pp
>             web2.pp
>             ...
>         mta.pp
>         mta/
>             mta1.pp
>             mta2.pp
>             ...
> 
> Subclasses in the modules directory are found via the autoloader, and as
> long as I follow the file naming conventions, that works fine. For
> classes and nodes, I have to use import. For example, in
> classes/webserver.pp I have "import webserver/*.pp" so that I can access
> classes webserver::apache2, webserver::iptables and so on. The same is
> done for nodes. I usually have a "generic node" where I set variables
> that are common for that class of nodes, and then the nodes themselves
> which inherit the generic node and set their own variables. To make that
> work, I use import in the same way as described above.
> 
> I understand that with the deprecation of "include", this will not work
> anymore. I can work around this for my classes by adding a new directory
> to the modulepath and then converting the directory structure to the
> manifests/files/templates structure with an init.pp file. However, what
> can I do about the nodes? The new feature of setting the manifest to a
> directory does not support subdirectories. Will I be forced to have all
> my nodes in the same directory and then rely on file names for
> organization? This is far from optimal in my opinion. What other
> alternatives do I have? If at all possible, I'd like to avoid using ENCs
> and keep using puppet files for node definitions.
> 
> Thanks in advance,
> Andre
> 

Hi Andre,

I believe you mean the deprecation of 'import'. The easiest way to fix
this is to cat all of your files together into one site.pp file.

Your usage of a base node that other nodes inherit is an anti-pattern
though and will cause you grief as you grow. Recommend reading about
Craig Dunn's roles and profiles pattern and hiera_include for
classifying nodes.

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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/537CD0E7.5050206%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to