summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-05-02 11:58:36 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-05-02 11:58:36 -0400
commit82f4bb814835a8aadcfe5cbba8bfbc4359c34b39 (patch)
tree1634a3ecfc84a14ce53ae8ff69a69ea0fc910849
parent7eb0fa0be305d1d682b29aaff6dde267402a9e6a (diff)
downloadthird_party-cobbler-82f4bb814835a8aadcfe5cbba8bfbc4359c34b39.tar.gz
third_party-cobbler-82f4bb814835a8aadcfe5cbba8bfbc4359c34b39.tar.xz
third_party-cobbler-82f4bb814835a8aadcfe5cbba8bfbc4359c34b39.zip
Apply John Eckersberg's patch for BIND management.
-rw-r--r--AUTHORS1
-rw-r--r--cobbler/action_sync.py4
-rw-r--r--cobbler/settings.py4
-rw-r--r--cobbler/webui/master.py1
-rw-r--r--config/settings1
-rw-r--r--docs/cobbler.pod14
-rw-r--r--setup.py4
-rw-r--r--triggers/restart-services.trigger9
-rw-r--r--website/new/docs/cobbler.html14
9 files changed, 47 insertions, 5 deletions
diff --git a/AUTHORS b/AUTHORS
index 5d2c797..cb26afc 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -11,6 +11,7 @@ Patches and other contributions from:
James Bowes <jbowes@redhat.com>
C. Daniel Chase <dan@cdchase.com>
Máirín Duffy <duffy@redhat.com>
+ John Eckersberg <jeckersb@redhat.com>
Tru Huynh <tru@pasteur.fr>
Matt Hyclak <hyclak@math.ohiou.edu>
Pablo Iranzo Gómez <pablo.iranzo@redhat.com>
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index 4156ea7..98faa0c 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -29,6 +29,7 @@ from cexceptions import *
import templar
import pxegen
import dhcpgen
+import dnsgen
import yumgen
import item_distro
@@ -84,6 +85,7 @@ class BootSync:
self.repos = self.config.repos()
self.pxegen = pxegen.PXEGen(self.config)
self.dhcpgen = dhcpgen.DHCPGen(self.config)
+ self.dnsgen = dnsgen.DNSGen(self.config)
self.yumgen = yumgen.YumGen(self.config)
# execute the core of the sync operation
@@ -98,6 +100,8 @@ class BootSync:
self.dhcpgen.write_dhcp_file()
self.dhcpgen.regen_ethers()
self.dhcpgen.regen_hosts()
+ if self.settings.manage_dns:
+ self.dnsgen.write_bind_files()
self.pxegen.make_pxe_menu()
# run post-triggers
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 491de75..a661768 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -57,6 +57,10 @@ DEFAULTS = {
},
"manage_dhcp" : 0,
"manage_dhcp_mode" : "isc",
+ "manage_dns" : 0,
+ "manage_forward_zones" : [],
+ "manage_reverse_zones" : [],
+ "named_conf" : "/etc/named.conf",
"next_server" : "127.0.0.1",
"omapi" : 1,
"omapi_port" : 647,
diff --git a/cobbler/webui/master.py b/cobbler/webui/master.py
index 22391eb..7e54a2d 100644
--- a/cobbler/webui/master.py
+++ b/cobbler/webui/master.py
@@ -35,7 +35,6 @@ __CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
__CHEETAH_genTime__ = 1209057202.737108
__CHEETAH_genTimestamp__ = 'Thu Apr 24 13:13:22 2008'
-__CHEETAH_src__ = 'webui_templates/master.tmpl'
__CHEETAH_srcLastModified__ = 'Thu Apr 24 12:59:37 2008'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
diff --git a/config/settings b/config/settings
index 724f419..6f2aff6 100644
--- a/config/settings
+++ b/config/settings
@@ -31,6 +31,7 @@ ldap_search_passwd: ''
ldap_search_prefix: 'uid='
manage_dhcp: 0
manage_dhcp_mode: isc
+manage_dns: 0
next_server: '127.0.0.1'
omapi: 1
omapi_port: 647
diff --git a/docs/cobbler.pod b/docs/cobbler.pod
index d7a4550..21ec78e 100644
--- a/docs/cobbler.pod
+++ b/docs/cobbler.pod
@@ -403,8 +403,8 @@ Cobbler sync is used to repair or rebuild the contents /tftpboot or /var/www/cob
Sync should be run whenever files in /var/lib/cobbler are manually edited (which is not recommended except for the settings file) or when making changes to kickstart files. In practice, this should not happen often, though running sync too many times does not cause any adverse effects.
-If using cobbler to manage a DHCP server (see the advanced section of this manpage), sync does need to be
-run after systems are added to regenerate and reload the DHCP configuration.
+If using cobbler to manage a DHCP and/or DNS server (see the advanced section of this manpage), sync does need to be
+run after systems are added to regenerate and reload the DHCP/DNS configuration.
=head1 EXAMPLES
@@ -565,6 +565,16 @@ Itanium systems names also need to be assigned to a distro that was created with
The dhcpd.conf file will be updated each time "cobbler sync" is run, and not until then, so it is important to remember to use "cobbler sync" when using this feature.
+=head2 BIND CONFIGURATION MANAGEMENT
+
+Cobbler can optionally manage DNS configuration using BIND.
+
+This feature is off by default and must be turned on by setting 'manage_dns' to 1 in /var/lib/cobbler/settings. You may restrict the scope of zones managed with the options 'manage_forward_zones' and 'manage_reverse_zones'.
+
+Cobbler will use /etc/cobbler/bind.template and /etc/cobbler/zone.template as a starting point for the named.conf and individual zone files, respectively. These files must be user edited for the user's particular networking environment. Read the file and understand how BIND works before proceeding.
+
+The named.conf file as well as all zone files will be updated each time ``cobbler sync'' is run, and not until then, so it is important to remember to use ``cobbler sync'' when using this feature.
+
=head2 SERVICE DISCOVERY (AVAHI)
If the avahi-tools package is installed, cobblerd will broadcast it's presence on the network, allowing it to be discovered by koan with the koan --server=DISCOVER parameter.
diff --git a/setup.py b/setup.py
index 91eabed..442da5b 100644
--- a/setup.py
+++ b/setup.py
@@ -94,13 +94,15 @@ if __name__ == "__main__":
(etcpath, ['kickstarts/sample_end.ks']),
(etcpath, ['kickstarts/default.ks']),
- # templates for DHCP and syslinux configs
+ # templates for DHCP, DNS, and syslinux configs
(etcpath, ['templates/dhcp.template']),
(etcpath, ['templates/dnsmasq.template']),
+ (etcpath, ['templates/named.template']),
(etcpath, ['templates/pxedefault.template']),
(etcpath, ['templates/pxesystem.template']),
(etcpath, ['templates/pxesystem_ia64.template']),
(etcpath, ['templates/pxeprofile.template']),
+ (etcpath, ['templates/zone.template']),
# kickstart dir
(vl_kick, []),
diff --git a/triggers/restart-services.trigger b/triggers/restart-services.trigger
index 6a0e320..24fc033 100644
--- a/triggers/restart-services.trigger
+++ b/triggers/restart-services.trigger
@@ -8,13 +8,13 @@ bootapi = capi.BootAPI()
settings = bootapi.settings()
manage_dhcp = str(settings.manage_dhcp).lower()
manage_dhcp_mode = str(settings.manage_dhcp_mode).lower()
+manage_dns = str(settings.manage_dns).lower()
omapi = settings.omapi
omapi_port = settings.omapi_port
# We're just going to restart DHCPD if using ISC and if not using OMAPI at all
-
rc = 0
if manage_dhcp != "0":
if manage_dhcp_mode == "isc":
@@ -27,4 +27,11 @@ if manage_dhcp != "0":
print "- error: unknown DHCP engine: %s" % manage_dhcp_mode
rc = 411
+if rc != 0:
+ sys.exit(rc)
+
+if manage_dns != "0":
+ rc = os.system("/sbin/service named restart")
+
sys.exit(rc)
+
diff --git a/website/new/docs/cobbler.html b/website/new/docs/cobbler.html
index 36ad3e0..06a8b14 100644
--- a/website/new/docs/cobbler.html
+++ b/website/new/docs/cobbler.html
@@ -661,6 +661,20 @@ the setting to 'isc'.</p>
<p>The dhcpd.conf file will be updated each time ``cobbler sync'' is run, and not until then, so it is important to remember to use ``cobbler sync'' when using this feature.</p>
<p>
</p>
+<h2><a name="bind_configuration_management">BIND CONFIGURATION MANAGEMENT</a></h2>
+<p>Cobbler can optionally manage DNS configuration using BIND.</p>
+<p>This feature is off by default and must be turned on by setting 'manage_dns' to 1 in
+/var/lib/cobbler/settings. You may restrict the scope of zones
+managed with the options 'manage_forward_zones' and
+'manage_reverse_zones'.
+<p>Cobbler will use /etc/cobbler/bind.template and
+ /etc/cobbler/zone.template as a starting point for the named.conf
+ and individual zone files, respectively. These files must be user
+ edited for the user's particular networking environment. Read the
+ file and understand how BIND works before proceeding.</p>
+<p>The named.conf file as well as all zone files will be updated each time ``cobbler sync'' is run, and not until then, so it is important to remember to use ``cobbler sync'' when using this feature.</p>
+<p>
+</p>
<h2><a name="service_discovery__avahi_">SERVICE DISCOVERY (AVAHI)</a></h2>
<p>If the avahi-tools package is installed, cobblerd will broadcast it's presence on the network, allowing it to be discovered by koan with the koan --server=DISCOVER parameter.</p>
<p>