ajjahn / puppet-dns

Module for provisioning DNS (bind9)
46 stars 112 forks source link

Add support for views #35

Open danzilio opened 10 years ago

danzilio commented 10 years ago

I really want to implement views, but after hacking at it for awhile, I'm not entirely sure how to implement this. The problem is that zones need to be nested inside the view in which they belong. There's a one-to-many relationship between views and zones, and the puppet language doesn't give us a good way implement this relationship. I've just started toying with the idea of implementing this by creating a namespace for the concat priority. An example would be the view having a concat priority of 1000, but using an inline template to make the concat priority of the zones inside that view be 1001. I'm really not sure what this would look like...I'm going to have to flesh it out some more. Any ideas?

danzilio commented 10 years ago

A drawback of the namespace idea would be that the number of views would be limited to the difference between the concat priority of the header content and the footer content. We could make it a large number, but it would still be a caveat.

kubashin-a commented 10 years ago

You can do this by using include statement of bind: /etc/bind/named.conf:

[skip]
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
# Views
include "/etc/bind/view1"
include "/etc/bind/view2"

/etc/bind/view1:

view "view1" {
[skip]
 zone "test1.lcl" {
[skip]
 zone "test2.lcl" {
[skip]

/etc/bind/view2:

view "view2" {
[skip]
 zone "test1.lcl" {
[skip]