On Friday, September 28, 2012 3:31:11 AM UTC-5, pierre-emmanuel degand 
wrote:
>
> Hi, I try to include or import a lot of configuration files in a node, but 
> it doesn't work :/
>
> I create a module to configure bind, but i have a lot of domains to 
> configure in the node of my server, so i decided to create an other module 
> just to register my configuration with 1 file per domain (i have around 200 
> domains, so arount 200 files...). 
>
> My tree (for the configuration module) : 
> module/
>
> conf_bind/
>
> manifests/
>
> init.pp
>
>  bind/
>
> domain1_conf.pp
>
> ...
>
> domain200_conf.pp
>
>
> Init.pp :
> class conf_bind {
> }
>
> I tried " import 'bind/*.pp' " , but it worked only once on my VM... The 
> only solution i have now it's to include my domain*_conf one by one, but 
> i'll be very long...
>
> If someone got an idea :) thanks
>
>
The 'import' function is the wrong tool for this job (indeed there is only 
about one job for which it is appropriate).

You don't describe the contents of your bind/domainX_conf.pp manifests, but 
with the layout you describe, each should be of this form:

class conf_bind::bind::domainX_conf {
  # declarations for configuring domain X...
}

Then in the module's init.pp you would have:

class conf_bind {
  include 'conf_bind::bind::domain1_conf'
  include 'conf_bind::bind::domain2_conf'
  # ...
  include 'conf_bind::bind::domain200_conf'
}

Puppet DSL does not provide a way to use pattern matching to assign classes 
to nodes, and it does not provide for textual interpolation in the manner 
of the C preprocessor's "#include" directive.  In particular, Puppet's 
'include' function performs a fundamentally different job than does cpp's 
"#include".


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/ueJrUZd_E84J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to