summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-10 12:25:53 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-10 12:25:53 -0500
commit0f365286251d26dfcc7e50a54fea6fd3591d3408 (patch)
treec0236440a20019d9c007cccfc08a3017d9de7562
parentc2d12b94867d9c02ca5ace4195975ac9c97325d5 (diff)
downloadthird_party-cobbler-0f365286251d26dfcc7e50a54fea6fd3591d3408.tar.gz
third_party-cobbler-0f365286251d26dfcc7e50a54fea6fd3591d3408.tar.xz
third_party-cobbler-0f365286251d26dfcc7e50a54fea6fd3591d3408.zip
Added http_port parameter to settings so Apache can run on ports other than 80.
-rw-r--r--CHANGELOG1
-rw-r--r--cobbler/action_import.py10
-rw-r--r--cobbler/action_reposync.py3
-rw-r--r--cobbler/action_sync.py17
-rw-r--r--cobbler/settings.py1
-rw-r--r--cobbler/utils.py6
-rw-r--r--config/settings1
7 files changed, 24 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3bf15ec..0ffe257 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ Cobbler CHANGELOG
- minor doc fixes
- fix for name of F8 comps.xml file
- added option --rsync-flags to import command
+- added http_port to settings to run Apache on non-80
- ...
* Mon Dec 10 2007 - 0.7.0
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index f37377c..20d1b5d 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -231,7 +231,7 @@ class Importer:
# how we set the tree depends on whether an explicit network_root was specified
if self.network_root is None:
- meta["tree"] = "http://@@server@@/cblr/links/%s" % (distro.name)
+ meta["tree"] = "http://@@http_server@@/cblr/links/%s" % (distro.name)
else:
# where we assign the kickstart source is relative to our current directory
# and the input start directory in the crawl. We find the path segments
@@ -425,21 +425,21 @@ class Importer:
fname = os.path.join(self.settings.webdir, "ks_mirror", "config", "%s-%s.repo" % (distro.name, counter))
- repo_url = "http://%s/cobbler/ks_mirror/config/%s-%s.repo" % (self.settings.server, distro.name, counter)
+ repo_url = "http://@@http_server@@/cobbler/ks_mirror/config/%s-%s.repo" % (distro.name, counter)
- repo_url2 = "http://%s/cobbler/ks_mirror/%s" % (self.settings.server, urlseg)
+ repo_url2 = "http://@@http_server@@/cobbler/ks_mirror/%s" % (urlseg)
distro.source_repos.append([repo_url,repo_url2])
# NOTE: the following file is now a Cheetah template, so it can be remapped
- # during sync, that's why we have the @@server@@ left as templating magic.
+ # during sync, that's why we have the @@http_server@@ left as templating magic.
# repo_url2 is actually no longer used. (?)
print _("- url: %s") % repo_url
config_file = open(fname, "w+")
config_file.write("[core-%s]\n" % counter)
config_file.write("name=core-%s\n" % counter)
- config_file.write("baseurl=http://@@server@@/cobbler/ks_mirror/%s\n" % (urlseg))
+ config_file.write("baseurl=http://@@http_server@@/cobbler/ks_mirror/%s\n" % (urlseg))
config_file.write("enabled=1\n")
config_file.write("gpgcheck=0\n")
# NOTE: yum priority defaults to 99 if that plugin is enabled
diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py
index 265bf48..4dce915 100644
--- a/cobbler/action_reposync.py
+++ b/cobbler/action_reposync.py
@@ -243,7 +243,8 @@ class RepoSync:
config_file.write("%s=%s\n" % (x, repo.yumopts[x]))
else:
line = "baseurl=%s\n" % repo.mirror
- line = line.replace("@@server@@",self.settings.server)
+ http_server = self.setting.server + ":" + self.settings.http_port
+ line = line.replace("@@server@@",http_server)
config_file.write(line)
config_file.write("enabled=1\n")
config_file.write("priority=%s\n" % repo.priority)
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index f94ca59..b61f525 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -401,15 +401,15 @@ class BootSync:
buf = ""
if system is not None:
if str(self.settings.pxe_just_once).upper() in [ "1", "Y", "YES", "TRUE" ]:
- buf = buf + "\n" + pattern1 % (blended["server"], system.name)
+ buf = buf + "\n" + pattern1 % (blended["http_server"], system.name)
if kickstart and os.path.exists(kickstart):
- buf = buf + "\n" + pattern2 % (blended["server"], "kickstarts_sys", system.name)
+ buf = buf + "\n" + pattern2 % (blended["http_server"], "kickstarts_sys", system.name)
if self.settings.run_post_install_trigger:
- buf = buf + "\n" + pattern3 % (blended["server"], system.name)
+ buf = buf + "\n" + pattern3 % (blended["http_server"], system.name)
else:
if kickstart and os.path.exists(kickstart):
- buf = buf + "\n" + pattern2 % (blended["server"], "kickstarts", profile.name)
+ buf = buf + "\n" + pattern2 % (blended["http_server"], "kickstarts", profile.name)
return buf
@@ -500,7 +500,7 @@ class BootSync:
name = c.split("/")[-1].replace(".repo","")
# add the line to create the yum config file on the target box
- conf = self.get_repo_config_file(blended["server"],urlseg,blended["name"],name)
+ conf = self.get_repo_config_file(blended["http_server"],urlseg,blended["name"],name)
buf = buf + "wget \"%s\" --output-document=/etc/yum.repos.d/%s.repo\n" % (conf, name)
return buf
@@ -708,7 +708,6 @@ class BootSync:
input_files.append(os.path.join(self.settings.webdir, "repo_mirror", repo, "config.repo"))
for infile in input_files:
- print "DEBUG: looking for infile: %s" % infile
if infile.find("ks_mirror") == -1:
dispname = infile.split("/")[-2]
else:
@@ -869,9 +868,9 @@ class BootSync:
if kickstart_path is not None and kickstart_path != "":
if system is not None and kickstart_path.startswith("/"):
- kickstart_path = "http://%s/cblr/kickstarts_sys/%s/ks.cfg" % (blended["server"], system.name)
+ kickstart_path = "http://%s/cblr/kickstarts_sys/%s/ks.cfg" % (blended["http_server"], system.name)
elif kickstart_path.startswith("/") or kickstart_path.find("/cobbler/kickstarts/") != -1:
- kickstart_path = "http://%s/cblr/kickstarts/%s/ks.cfg" % (blended["server"], profile.name)
+ kickstart_path = "http://%s/cblr/kickstarts/%s/ks.cfg" % (blended["http_server"], profile.name)
if distro.breed is None or distro.breed == "redhat":
append_line = "%s ks=%s" % (append_line, kickstart_path)
@@ -945,7 +944,7 @@ class BootSync:
fd = open(filename, "w+")
if blended.has_key("kickstart") and blended["kickstart"].startswith("/"):
# write the file location as needed by koan
- blended["kickstart"] = "http://%s/cblr/kickstarts/%s/ks.cfg" % (blended["server"], profile.name)
+ blended["kickstart"] = "http://%s/cblr/kickstarts/%s/ks.cfg" % (blended["http_server"], profile.name)
fd.write(yaml.dump(blended))
fd.close()
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 1c63a34..c391554 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -34,6 +34,7 @@ DEFAULTS = {
"dnsmasq_bin" : "/usr/sbin/dnsmasq",
"dnsmasq_conf" : "/etc/dnsmasq.conf",
"httpd_bin" : "/usr/sbin/httpd",
+ "http_port" : 80,
"kerberos_realm" : "example.org",
"kernel_options" : {
"lang" : " ",
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 20a5d67..80dae73 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -323,6 +323,12 @@ def blender(api_handle,remove_hashes, root_obj, blend_cache=None):
if not results.has_key(key):
results[key] = interface[key]
+ http_port = results.get("http_port",80)
+ if http_port != 80:
+ results["http_server"] = "%s:%s" % (results["server"] , http_port)
+ else:
+ results["http_server"] = results["server"]
+
# sanitize output for koan and kernel option lines, etc
if remove_hashes:
results = flatten(results)
diff --git a/config/settings b/config/settings
index f05c288..245fc17 100644
--- a/config/settings
+++ b/config/settings
@@ -10,6 +10,7 @@ dhcpd_conf: /etc/dhcpd.conf
dnsmasq_bin: /usr/sbin/dnsmasq
dnsmasq_conf: /etc/dnsmasq.conf
httpd_bin: /usr/sbin/httpd
+http_port: 80
kerberos_realm: 'example.org'
kernel_options:
ksdevice: eth0