In my environment I need to have finer-grained control of the BIND
zone statements generated by cobbler, so I cooked up a quick patch
that lets me do stuff like this:
#for $zone in $forward_zones
zone "$zone" in {
type master;
file "$zone";
allow-query {
any;
};
allow-transfer {
localhost;
X.X.X.X;
Y.Y.Y.Y;
};
};
#end for
#for $zone, $arpa in $reverse_zones
zone "$arpa" in {
type master;
file "$zone";
allow-query {
any;
};
allow-transfer {
localhost;
X.X.X.X;
Y.Y.Y.Y;
};
};
#end for
I've attached a version of the patch against devel, I have versions of
the patch for both devel and master in my git repo:
git://fedorapeople.org/home/fedora/jcollie/public_git/cobbler.git
branches "devel-bindzone" and "master-bindzone"
--
Jeff Ollie
"You know, I used to think it was awful that life was so unfair. Then
I thought, wouldn't it be much worse if life were fair, and all the
terrible things that happen to us come because we actually deserve
them? So, now I take great comfort in the general hostility and
unfairness of the universe."
-- Marcus to Franklin in Babylon 5: "A Late Delivery from Avalon"
From 6b91026407d1dc6bdd016b4990bcd198778b67d3 Mon Sep 17 00:00:00 2001
From: Jeffrey C. Ollie <[email protected]>
Date: Mon, 15 Dec 2008 20:41:07 -0600
Subject: [PATCH] Allow finer grained control of the BIND zone statements.
---
cobbler/modules/manage_bind.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cobbler/modules/manage_bind.py b/cobbler/modules/manage_bind.py
index 2f6e18a..e7cdc3a 100644
--- a/cobbler/modules/manage_bind.py
+++ b/cobbler/modules/manage_bind.py
@@ -176,8 +176,11 @@ class BindManager:
forward_zones = self.settings.manage_forward_zones
reverse_zones = self.settings.manage_reverse_zones
- metadata = {'zone_include': ''}
- for zone in self.__forward_zones().keys():
+ metadata = {'forward_zones': self.__forward_zones().keys(),
+ 'reverse_zones': [],
+ 'zone_include': ''}
+
+ for zone in metadata['forward_zones']:
txt = """
zone "%(zone)s." {
type master;
@@ -190,6 +193,7 @@ zone "%(zone)s." {
tokens = zone.split('.')
tokens.reverse()
arpa = '.'.join(tokens) + '.in-addr.arpa'
+ metadata['reverse_zones'].append((zone, arpa))
txt = """
zone "%(arpa)s." {
type master;
--
1.6.0.4
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler