Assuming all the dns servers are getting the same config, We break big chunks 
like that out into their own modules. So:

node dns1.myco.com {
  include myco::dns
}

node web1.myco.com {
  include myco::web
}

If the servers have different configs, you can make myco::dns::common, 
myco::dns::this myco::dns::that myco::dns::other.

We also use a "role" fact instead of a regex on the fqdn for case statements, 
but even those are fragile. I prefer to explicitly include things in the node 
definitions. It's a bit verbose, but its also clear for anyone else that has to 
maintain the code.

— Mason Turner

On Aug 7, 2013, at 9:55 AM, [email protected] wrote:

> Hi,
> 
> I use puppet to manage servers in a mutualized hosting context and I get some 
> trouble concerning the node definitions.
> 
> For example on dns nodes I have to declare many `bind::zone` resources like 
> this:
> 
> bind::zone { ['website1.com']:
>   expire => 604800,
>   minimum => 3600,
>   ttl => 38400,
>   …
>   records => [
>     'www        IN    A    xxx.xxx.xxx.xxx'
>     …
>         ]
> }
> 
> bind::zone { ['website2.com']:
>   expire => 604800,
>   minimum => 3600,
>   ttl => 38400,
>   …
>   records => [
>     'www        IN    A    xxx.xxx.xxx.xxx'
>     …
>         ]
> }
> 
> … and hundred others like this.
> 
> Finally, the file containing node definition became very big and difficult to 
> maintain.
> I have the same issue for a webserver with apache::vhost resources for 
> example.
> 
> For the moment I use a workaround like this:
> 
> import vhosts/*.pp
> 
> And in each files I put a condition to make a restriction for a particular 
> nodes like this:
> 
> if $::fqdn =~ /^web(\d*)\.example\.net$/ {
>     apache::vhost { 'website2':
>     …
>     }
> }
> 
> I suppose that many puppet users use puppet to manage nodes in mutualized 
> hosting context and I would ask if someone have a better solution for this 
> issue?
> 
> Regards,
> 
> Thomas
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to