Building Koan 1.2 for RHEL3 or CentOS 3
by Tom Georgoulias
Anyone successfully built Koan 1.2.0 on RHEL3 or CentOS 3? I can't
build it on my rhel3.8 server because it requires python-setuptools, and
a rebuild of python-setuptools-0.6c8 isn't building because of this error:
setuptools/dist.py:620: Warning: 'yield' will become a reserved keyword
in the future
Traceback (most recent call last):
File "setup.py", line 12, in ?
from setuptools import setup, find_packages
File "setuptools/__init__.py", line 2, in ?
from setuptools.extension import Extension, Library
File "setuptools/extension.py", line 2, in ?
from dist import _get_unpatched
File "setuptools/dist.py", line 620
yield pkg
^
SyntaxError: invalid syntax
error: Bad exit status from /var/tmp/rpm-tmp.70662 (%build)
Was hoping to avoid a trip down a rabbit hole if at all possible...
Thanks,
Tom
15 years, 7 months
Problems with custom install
by Chris O'Regan
I am setting up a custom install of cobbler v1.2.4 (custom in the sense
that I am massaging it into our application tree). Unfortunately
something appears to be broken. Simple things like "cobbler --help" or
"cobbler <ACTION> --help" work, but other tasks do not. The messages I
am getting seem to indicate syntax or programming errors. Any ideas?
Thanks in advance.
[repo@courage repo]$ cobbler check
local variable 'rc' referenced before assignment
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/cobbler.py",
line 77, in main
rc = BootCLI().run(sys.argv)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/cobbler.py",
line 57, in run
return self.loader.run(args)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/commands.py",
line 116, in run
return fn.run()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/modules/cli_misc.py",
line 53, in run
status = self.api.check()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/api.py",
line 357, in check
return check.run()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/action_check.py",
line 68, in run
self.check_service(status, "cobblerd")
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/action_check.py",
line 92, in check_service
if rc != 0:
[repo@courage repo]$ cobbler sync
invalid literal for float(): 5server
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/cobbler.py",
line 77, in main
rc = BootCLI().run(sys.argv)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/cobbler.py",
line 57, in run
return self.loader.run(args)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/commands.py",
line 116, in run
return fn.run()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/modules/cli_misc.py",
line 223, in run
return self.api.sync()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/api.py",
line 380, in sync
sync = self.get_sync()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/api.py",
line 394, in get_sync
return action_sync.BootSync(self._config,dhcp=self.dhcp,dns=self.dns)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/action_sync.py",
line 68, in __init__
self.pxegen = pxegen.PXEGen(config)
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/pxegen.py",
line 65, in __init__
self.bootloc = utils.tftpboot_location()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/utils.py",
line 752, in tftpboot_location
(make,version,rest) = os_release()
File
"/local/pkg/python-2.5.2/root/lib/python2.5/site-packages/cobbler/utils.py",
line 724, in os_release
return (make, float(version), rest)
Chris
15 years, 7 months
how can I watch cobbler parse my kickstart template?
by Tom Georgoulias
I discovered a problem with our cobbler server this morning and am
having a hard time tracking down the root cause. I would like to know
if/how I could get more debugging output from the "cobbler sync" command.
We use a single kickstart cheetah template for all of our profiles and
source in the correct parition scheme for a system based on some
hardware configs that are part of our ksmeta data.
## PARTITIONING:
#if $getVar("hardware","none") == "none"
## Default:
SNIPPET::partition_select
#else if $getVar("hardware", "None") == "8832sem"
SNIPPET::PART.8832sem
#else if $getVar("hardware", "None") == "8832"
SNIPPET::PART.8832
#else if $getVar("hardware", "None") == "8843sem"
SNIPPET::PART.8843sem
#else if $getVar("hardware", "None") == "8843"
SNIPPET::PART.8843
#else if $getVar("hardware", "None") == "8853sem"
SNIPPET::PART.8853sem
In the case of the 8843sem and 8853sem, the letters "sem" are inserted
into the ks.cfg right after the contents of the PART.8853sem snippet
file. This isn't the case for the 8832sem.
Also, I've quadruple checked the contents of the PART.8853sem and
PART.8843sem files and "sem" isn't hidden anywhere, so I'm sure its
happening in the logic above.
If I make a symlink named "PART.8853semSL" and point it back to the
8853sem file, everything works.
We are using cobbler-0.8.2-1 at this time, so I hope we aren't so out of
date that everyone has forgotten how cobbler used to work! ;)
Any help or tips are appreciated.
Thanks,
Tom
15 years, 7 months
[devel] cleanup of "cobbler report" command
by Michael DeHaan
We now have a much enhanced "cobbler report" command that can output
data in a variety of formats.
It can also do things like cobbler report --name=foo without having to
say what the type of a "foo" is. So it saves typing.
Given this, it would be helpful to remove the cobbler syntax:
cobbler system report --name=foo
Since you can just say
cobbler report --name=foo
OR: cobbler report --what=systems
Similarly, removing "cobbler system list" allows for some nice code
cleanup, if we allow:
cobbler list --what=systems
Sound ok?
This would make the command modules a bit easier to hack on as well, and
removes some ambiguity with commands being offered in more than one place.
--Michael
15 years, 7 months
python script to generate nagios configs
by Léon Keijser
Hi,
I've created a python script to quickly generate Nagios configuration
files based on cobbler profiles, using xmlrpc.
Requirements:
1) Begin your partitions definitions with the following comment:
# BEGINPARTITIONS
and put
# ENDPARTITIONS
at the end. This is because the script will render the entire kickstart,
look for these 2 lines and take everything in the middle as partitions.
2) a working nagios installation
Syntax is: ./nagios.py -y systemname -k customername
It will then create a nagios configuration file as:
/etc/nagios/objects/customername/systemname.cfg
include this dir in your nagios.cfg
(cfg_dir=/etc/nagios/objects/customername) and restart Nagios.
It will also create a hostgroup.cfg in the same directory and add all
found systems' cfg files in that dir to it as members of the group.
Disclaimer: my python skills are sub-optimal. The code might require
some improvement ;)
Everything can be found under 'leon-nagios' at:
http://bender.newnewyork.nl/git/gitweb.cgi
Kind regards,
Léon Keijser
Stone-IT
15 years, 7 months
3 profiles listed- only 2 show in menu
by Dave Augustus
Hello All,
My distro list has 2 entries but only one shows in the ks menu.
Here are the entries:
CentOS52-x86_64
CentOS52-xen-x86_64
Here is the pxe menu:
(local)
CentOS52-x86_64
rescue-CentOS52-x86_64
Here was the import command I used:
cobbler import --path=/home/repos/centos/5.2/os/x86_64 --name=CentOS52
--available-as=nfs://192.168.35.132:/home/repos/centos/5.2/os/x86_64
...and the output....
---------------- (adding distros)
- creating new distro: CentOS52-x86_64
- creating new profile: CentOS52-x86_64
- creating new profile: rescue-CentOS52-x86_64
- creating new distro: CentOS52-xen-x86_64
- creating new profile: CentOS52-xen-x86_64
---------------- (associating kickstarts)
---------------- (syncing)
the profile that is not displaying is the XEN version- why? Yes, I
checked that profile and *enable menu* is checked.
Thanks,
Dave
15 years, 7 months
More patches - RE:New tool: /usr/bin/cobbler-setup
by Partha Aji
Hey Michael,
I basically fixed most of the Fix Me, removed some unused stuff... Fixed
the cobbler.spec to generate the correct rpms.. Updated the templates to
new stuff. I have questions on 3 fix mes that I have to implement
# FIXME: missing code to ensure TFTP is enabled
# FIXME: missing code to configure firewall (???)
# FIXME: missing code to ensure cobblerd, httpd, xinetd is
chkconfig on
I was wondering if I could simply use the cobbler check logic found in
cobbler.cobbler.action_check to do the validation for TFTP enabled and
configuring firewall. Secondly are we sure about wanting chkconfig on
for those services right (I thought sysadmins were wary of those things)..
I was also confused on when to do Subprocess.call( shell=True) vs (shell
= False). I currently use Shell = False unless the thing barfed saying
can;t execute the child process in which case I 'd go for shell = True
.. I had to do shell = True for for '/sbin/service cobblerd restart',
and "/sbin/service httpd restart" .. I added the logic to check return
codes and cease execution if it failed.. Please review the attached
patches when you have time and apply them accordingly.. I'll meanwhile
work on doing the TFTP enablement checks...
PS:
I was wondering if you were ok with autogenerating the modules.conf &
settings files when they install the cobbler RPM.
For example we can have a post script that runs
'/usr/bin/cobbler-setup -a /usr/share/cobbler/installer_templates/defaults'
This will make the templates the defacto place to add all the new config
entries... You can add the default values to installer_templates/defaults
That way we don't need keep installer_templates/modules.conf.template in
sync with config/modules.conf... Please let me know what you think of
the idea... Thanks for the reviews in the last commit..
Partha
>From e7a70fa53d3367edea426ea3d21b6097b8697f17 Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Thu, 18 Sep 2008 19:38:19 -0400
Subject: [PATCH] made some changes relatedto the fix me comments
---
scripts/cobbler-setup | 179 +++++++++++++++++--------------------------------
1 files changed, 62 insertions(+), 117 deletions(-)
diff --git a/scripts/cobbler-setup b/scripts/cobbler-setup
index f835f77..5ecdca7 100755
--- a/scripts/cobbler-setup
+++ b/scripts/cobbler-setup
@@ -33,11 +33,9 @@ import exceptions
# FIXME: use subprocess.call() with shell=False instead
# FIXME: check all return codes
-from os import system
-
import sys
import os
-from decimal import Decimal
+
try:
import readline
@@ -92,39 +90,6 @@ def help_ask(caption, validators=[], transformers =[], default = None, required=
required = required, max_len = max_len)
return input
-# =========================================================
-
-def to_int(input):
- """
- A transformer emthod to convert a string input to an integer
- """
-
- try:
- return int(input)
- except ValueError:
- raise AnswerException ('Input is not an integer')
-
-# =========================================================
-
-def to_float(input):
- """
- A transformer emthod to convert a string input to a float.
- """
- try:
- return float(input)
- except ValueError, e:
- raise AnswerException ('Input needs to be a number')
-
-# =========================================================
-
-def to_decimal(input):
- """
- A transformer emthod to convert a string input to an decimal
- """
- try:
- return Decimal(input)
- except:
- raise AnswerException ('Input needs to be a number (can be a decimal)')
# =========================================================
@@ -190,22 +155,21 @@ def yes_no_check():
return enum_check(["y","n"])
# =========================================================
+def yes_no_params(default = 'y'):
+ return {
+ "default" : default,
+ "validators" : [yes_no_check()],
+ "transformers" : [yes_no_translator()]
+ }
-def range_check(min_val = None, max_val = None):
- """
- Ensures that the numeric value o an input falls between a given range.
- """
- def check(input, min_val = min_val, max_val = max_val):
- input = to_decimal(input)
- if min_val and max_val and not (min_val <= input <= max_val):
- raise AnswerException('Input needs to be between %d and %d ' % (min_val, max_val))
- elif min_val and input < min_val:
- raise AnswerException('Input needs to be >= %d' % min_val)
- elif max_val and input > max_val:
- raise AnswerException('Input needs to be <= %d' % max_val)
-
- return check
-
+# =========================================================
+def translation_params(default, translation):
+ return {
+ "default" : default,
+ "validators" : [enum_check(translation.keys())],
+ "transformers" : [translator(translation)]
+ }
+
# =========================================================
def setup_server(answers):
@@ -216,15 +180,15 @@ def setup_server(answers):
parameters
)
+
# =========================================================
def setup_dhcp(answers):
- parameters = {
- "default" : "y",
- "validators" : [yes_no_check()],
- "transformers" : [yes_no_translator()]
- }
- ask(answers,'enable_dhcp',"Do you want to enable DHCP management [y/n] ?",parameters)
+
+ ask(answers,
+ 'enable_dhcp',
+ "Do you want to enable DHCP management [y/n] ?",
+ yes_no_params())
if answers['enable_dhcp']:
answers['next_server'] = answers['server']
@@ -235,20 +199,15 @@ def setup_dhcp(answers):
if answers['enable_dhcp']:
# DHCP management is either ISC or dnsmasq
- translators = {
+ translation = {
"isc" : "manage_isc",
"dnsmasq" : "manage_dnsmasq"
}
- parameters = {
- "default" : "isc",
- "validators" : [enum_check(translators.keys())],
- "transformers" : [translator(translators)]
- }
ask(
answers,
'dhcp_module',
"Which DNS module do you want to use [isc/dnsmasq] ?",
- parameters
+ translation_params("isc", translation)
)
else:
@@ -258,19 +217,12 @@ def setup_dhcp(answers):
# =========================================================
def setup_dns(answers):
-
- parameters = {
- "default" : "y",
- "validators" : [yes_no_check()],
- "transformers" : [yes_no_translator()]
- }
-
# if the user already is using dnsmasq for DHCP, they must use dnsmasq for DNS
# if they are not, they get the choice of BIND or no module
if answers["enable_dhcp"] and answers["dhcp_module"] == "dnsmasq":
- answers["enable_dns"] = True
+ answers["enable_dns"] = 1
answers["dns_module"] = "manage_dnsmasq"
else:
@@ -278,83 +230,76 @@ def setup_dns(answers):
ask(answers,
'enable_dns',
"Do you want to enable DNS management with BIND [y/n] ?",
- parameters
+ yes_no_params()
)
if answers["enable_dns"]:
answers["dns_module"] = "manage_bind"
+
+
# =========================================================
def setup_pxe(answers):
- parameters = {
- "default" : "y",
- "validators" : [yes_no_check()],
- "transformers" : [yes_no_translator()]
- }
-
ask(
answers,
'pxe_once',
"Enable PXE boot loop prevention feature [y/n] ?",
- parameters
+ yes_no_params()
)
# =========================================================
def setup_mirrors(answers):
- parameters = {
- "default" : "n",
- "validators" : [yes_no_check()],
- "transformers" : [yes_no_translator()]
- }
ask(
answers,
'yum_post_install_mirror',
"Make cobbler managed yum repos available to installed systems via yum.repos.d [y/n] ?",
- parameters
+ yes_no_params()
)
# =========================================================
def setup_remote_config(answers):
-
ask (answers, "enable_remote_access",
"Allow cobbler to be managed by the web and other applications [y/n] ?",
- dict(default="y", validators=[yes_no_check()],
- transformers=[yes_no_translator()]))
+ yes_no_params()
+ )
if answers['enable_remote_access']:
- translation = dict (testing = "authn_testing",
- passthru = "authn_passthru",
- denyall = "authn_denyall",
- ldap = "authn_ldap",
- configfile = "authn_configfile",
- spacewalk = "authn_spacewalk"
- )
+ translation = {
+ "testing" : "authn_testing",
+ "passthru" : "authn_passthru",
+ "denyall" : "authn_denyall",
+ "ldap" : "authn_ldap",
+ "configfile" : "authn_configfile",
+ "spacewalk" :"authn_spacewalk"
+ }
+
- ask (answers, "authn_module",
+ ask (answers,
+ "authn_module",
"Which authentication module do you want to use [%s] ?" % "/".join(translation.keys()),
- dict(default="denyall",
- validators=[enum_check(translation.keys())],
- transformers= [translator(translation)]))
+ translation_params("denyall", translation))
if answers['authn_module'] == 'authn_configfile':
print "* Updating cobbler user's password in user.digest file"
os.system('htdigest -c users.digest Cobbler cobbler')
print "* users can run 'htdigest /etc/users.digest Cobbler $username' later to add more users & change cobbler password"
+
+ translation = {
+ "allowall" : "authz_allowall",
+ "ownership" : "authz_ownership",
+ "configfile" : "authz_configfile"
+ }
- translation = dict (allowall = "authz_allowall",
- ownership = "authz_ownership",
- configfile = "authz_configfile")
-
- ask (answers, "authz_module",
- "Which authorization module do you want to use [%s] ?" % "/".join(translation.keys()),
- dict(default="allowall",
- validators=[enum_check(translation.keys())],
- transformers= [translator(translation)]))
+ ask (answers,
+ "authz_module",
+ "Which authorization module do you want to use [%s] ?" % "/".join(translation.keys()),
+ translation_params("allowall", translation))
+
else:
@@ -417,6 +362,14 @@ def copy_settings():
# =========================================================
def main():
+ parser = optparse.OptionParser()
+ setup(parser)
+ (options, args) = parser.parse_args()
+ answers = {}
+ # options.file is the name of the answers file..
+ if options.file:
+ data = yaml.loadFile(parser.file).next()
+ answers.update(data)
print ""
print "**********************************************"
@@ -433,15 +386,7 @@ def main():
print "**********************************************"
print ""
- parser = optparse.OptionParser()
- setup(parser)
- (options, args) = parser.parse_args()
- answers = {}
- # FIXME: add --file with help to option parser
- #if options.file:
- # data = yaml.loadFile(parser.file).next()
- # answers.update(data)
setup_server(answers)
setup_dhcp(answers)
--
1.5.5.1
>From f944d0596a655dd1213ae12f135d64364a5182b6 Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Thu, 18 Sep 2008 19:38:35 -0400
Subject: [PATCH] Corrected the cobbler spec..
---
cobbler.spec | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/cobbler.spec b/cobbler.spec
index e6750ff..ab99ddf 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -122,6 +122,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{_bindir}/cobbler
%{_bindir}/cobbler-ext-nodes
%{_bindir}/cobblerd
+%{_bindir}/cobbler-setup
%{_bindir}/cobbler-completion
# %defattr(644,root,root)
@@ -210,6 +211,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%config(noreplace) /var/lib/cobbler/snippets/pre_partition_select
%config(noreplace) /var/lib/cobbler/snippets/main_partition_select
%config(noreplace) /var/lib/cobbler/snippets/post_install_kernel_options
+%config(noreplace) /var/lib/cobbler/snippets/network_config
/var/lib/cobbler/elilo-3.6-ia64.efi
/var/lib/cobbler/menu.c32
%defattr(660,root,root)
--
1.5.5.1
>From f135524009cb66737a2b4b8255ea6b6faae1ef2a Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Fri, 19 Sep 2008 16:03:47 -0400
Subject: [PATCH] Updated the templates .. Also added defualts file, that holds the default template values ..
---
cobbler.spec | 2 +
installer_templates/defaults | 11 ++++
installer_templates/modules.conf.template | 93 ++++++++++++++++++++++++++--
installer_templates/settings.template | 53 ++++++++++++-----
scripts/cobbler-setup | 7 +-
setup.py | 1 +
6 files changed, 142 insertions(+), 25 deletions(-)
create mode 100644 installer_templates/defaults
diff --git a/cobbler.spec b/cobbler.spec
index ab99ddf..4ed1cfd 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -95,6 +95,8 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%dir /usr/share/cobbler/installer_templates
%defattr(744,root,root)
/usr/share/cobbler/installer_templates/*.template
+%defattr(744,root,root)
+/usr/share/cobbler/installer_templates/defaults
%defattr(755,apache,apache)
%dir /usr/share/cobbler/webui_templates
%defattr(444,apache,apache)
diff --git a/installer_templates/defaults b/installer_templates/defaults
new file mode 100644
index 0000000..34d5a0d
--- /dev/null
+++ b/installer_templates/defaults
@@ -0,0 +1,11 @@
+authn_module:'authn_denyall'
+authz_module:'authz_allowall'
+dns_module:'manage_bind'
+dhcp_module:'manage_isc'
+enable_dhcp:0
+enable_dns:0
+next_server:'127.0.0.1'
+pxe_once:0
+server:'127.0.0.1'
+spacewalk_url:'http://localhost/rpc/api'
+yum_post_install_mirror:0
diff --git a/installer_templates/modules.conf.template b/installer_templates/modules.conf.template
index 6b66b07..0acd5fd 100644
--- a/installer_templates/modules.conf.template
+++ b/installer_templates/modules.conf.template
@@ -1,26 +1,105 @@
# this file was auto-generated by /usr/bin/cobbler-setup
#import time
-$time.asctime()
+#$time.asctime()
# the previous file is saved as /etc/cobbler/settings.backup
-# FIXME: this file is based on an older version of cobbler and needs to be updated to devel
+# specifies what cobbler modules to load.
+# what file/data formats to use for metadata
+#
+# choices:
+# serializer_catalog (fast, uses .d directories in /var/lib/cobbler/config)
+# serializer_yaml (original serializer, uses a few text files)
+#
+# for 99% or more of all installations, use serializer_catalog.
+#
+# NOTE: serializer changes may remove your ability to access old data.
+# serializer_yaml users can change to serializer_catalog w/o manual
+# migration steps. Other changes are for new installs only.
[serializers]
-settings = serializer_yaml
-distro = serializer_yaml
-profile = serializer_yaml
-system = serializer_yaml
-repo = serializer_yaml
+settings = serializer_catalog
+distro = serializer_catalog
+profile = serializer_catalog
+system = serializer_catalog
+repo = serializer_catalog
+image = serializer_catalog
+
+# policy: what users can log into the WebUI and Read-Write XMLRPC?
+#
+# choices:
+# authn_denyall -- no one (default)
+# authn_configfile -- use /etc/cobbler/users.digest (for basic setups)
+# authn_passthru -- ask Apache to handle it (used for kerberos)
+# authn_ldap -- authenticate against LDAP
+# authn_spacewalk -- ask Spacewalk/Satellite (experimental)
+# authn_testing -- username/password is always testing/testing (debug)
+# (user supplied) -- you may write your own module
+#
+# WARNING: this is a security setting, do not choose an option blindly.
+#
+# for more information:
+# https://fedorahosted.org/cobbler/wiki/CobblerWebInterface
+# https://fedorahosted.org/cobbler/wiki/CustomizableSecurity
+# https://fedorahosted.org/cobbler/wiki/CobblerWithKerberos
+# https://fedorahosted.org/cobbler/wiki/CobblerWithLdap
[authentication]
module = $authn_module
+# policy: once a user has been cleared by the WebUI/XMLRPC, what can they do?
+#
+# choices:
+# authz_allowall -- full access for all authneticated users (default)
+# authz_configfile -- determined by /etc/cobbler/users.conf
+# authz_ownership -- use users.conf, but add object ownership semantics
+# (user supplied) -- you may write your own module
+#
+# WARNING: this is a security setting, do not choose an option blindly.
+#
+# If you want to further restrict cobbler with ACLs for various groups,
+# pick authz_ownership. authz_allowall does not support ACLs. configfile
+# does but does not support object ownership which is useful as an additional
+# layer of control.
+
+# for more information:
+# https://fedorahosted.org/cobbler/wiki/CobblerWebInterface
+# https://fedorahosted.org/cobbler/wiki/CustomizableSecurity
+# https://fedorahosted.org/cobbler/wiki/CustomizableAuthorization
+# https://fedorahosted.org/cobbler/wiki/AuthorizationWithOwnership
+# https://fedorahosted.org/cobbler/wiki/AclFeature
+
[authorization]
module = $authz_module
+# chooses the DNS management engine if manage_dns is enabled
+# in /etc/cobbler/settings, which is off by default.
+#
+# choices:
+# manage_bind -- default, uses BIND/named
+# manage_dnsmasq -- uses dnsmasq, also must select dnsmasq for dhcp below
+#
+# NOTE: more configuration is still required in /etc/cobbler
+#
+# for more information:
+# https://fedorahosted.org/cobbler/wiki/ManageDns
+
[dns]
module = $dns_module
+# chooses the DHCP management engine if manage_dhcp is enabled
+# in /etc/cobbler/settings, which is off by default.
+#
+# choices:
+# manage_isc -- default, uses ISC dhcpd
+# manage_dnsmasq -- uses dnsmasq, also must select dnsmasq for dns above
+#
+# NOTE: more configuration is still required in /etc/cobbler
+#
+# for more information:
+# https://fedorahosted.org/cobbler/wiki/ManageDhcp
+
[dhcp]
module = $dhcp_module
+
+#--------------------------------------------------
diff --git a/installer_templates/settings.template b/installer_templates/settings.template
index cbf6e58..96b838c 100644
--- a/installer_templates/settings.template
+++ b/installer_templates/settings.template
@@ -1,16 +1,15 @@
---
-# this file was auto-generated by /usr/bin/cobbler-setup
+## this file was auto-generated by /usr/bin/cobbler-setup
#import time
-$time.asctime()
+#$time.asctime()
# the previous file is saved as /etc/cobbler/settings.backup
-
-# FIXME: this file is based on an older version of cobbler
-# and needs to be updated to devel/latest
-
# cobbler settings file
-# run "cobbler sync" after making changes
+# restart cobblerd and consider running "cobbler sync" after making changes
# (it's a good idea to make backups too)
#
+# This config file is in YAML 1.0 format
+# see http://yaml.org
+#
# if 1, cobbler will allow insertions of system records that duplicate
# the mac address information of other system records. In general,
# this is undesirable.
@@ -34,6 +33,7 @@ default_virt_bridge: xenbr0
# if koan is invoked without --virt-type and no virt-type
# is set on the profile/system, what virtualization type
# should be assumed? Values: xenpv, xenfv, qemu, vmware
+# (NOTE: this does not change what virt_type is chosen by import)
default_virt_type: xenpv
# use this as the default disk size for virt guests (GB)
@@ -47,6 +47,15 @@ default_virt_ram: 512
# owner and/or group. Can be a comma seperated list.
default_ownership: "admin"
+# controls whether cobbler will add each new profile entry to the default
+# PXE boot menu. This can be over-ridden on a per-profile
+# basis when adding/editing profiles with --enable-menu=0/1. Users
+# should ordinarily leave this setting enabled unless they are concerned
+# with accidental reinstalls from users who select an entry at the PXE
+# boot menu. Adding a password to the boot menus templates
+# may also be a good solution to prevent unwanted reinstallations
+enable_menu: 1
+
# location for some important binaries and config files
# that can vary based on the distribution.
dhcpd_bin: /usr/sbin/dhcpd
@@ -93,6 +102,18 @@ manage_dns: $enable_dns
manage_forward_zones: []
manage_reverse_zones: []
+# cobbler has a feature that allows for integration with config management
+# systems such as Puppet. The following parameters work in conjunction with
+# --mgmt-classes and are described in furhter detail at:
+# https://fedorahosted.org/cobbler/wiki/UsingCobblerWithConfigManagementSystem
+mgmt_classes: []
+mgmt_parameters:
+ from_cobbler: 1
+
+# location where cobbler will write its named.conf when BIND dns management is
+# enabled
+named_conf: /etc/named.conf
+
# if using cobbler with manage_dhcp, put the IP address
# of the cobbler server here so that PXE booting guests can find it
# if you do not set this correctly, this will be manifested in TFTP open timeouts.
@@ -156,6 +177,12 @@ server: $server
# this directory should not be required.
snippetsdir: /var/lib/cobbler/snippets
+# if modules.conf specifies authn_spacewalk, this is the XMLRPC
+# endpoint to authenticate against. If Satellite/Spacewalk is
+# not in use, ignore this setting entirely.
+# See fedorahosted.org/spacewalk for details on that project.
+spacewalk_url: $spacewalk_url
+
# by default, installs are set to send syslog traffic on this port
# and cobblerd will listen on this port. syslog data (for installs
# that support it... RHEL 5 and later, etc) is logged in /var/log/cobbler
@@ -198,12 +225,8 @@ xmlrpc_rw_port: 25152
# this as 0. In that case, the cobbler mirrored yum repos are still
# accessable at http://cobbler.example.org/cblr/repo_mirror and yum
# configuration can still be done manually. This is just a shortcut.
-yum_post_install_mirror: $yum_post_install_mirror
-
-# "cobbler repo" support normally uses rsync or reposync. If --rpm-list
-# is used, it's possible to download only a certain package list, plus
-# dependencies, but --resolve and other flags are not supported in
-# all versions of yumdownloader. This is a list of what flags
-# to pass to it. Only change this if you are experiencing problems
-# with "cobbler reposync" and are using --rpm-list.
+yum_post_install_mirror: $yum_post_install_mirror
+
+# additional flags to yum commands
+yumreposync_flags: "-l"
yumdownloader_flags: "--resolve"
diff --git a/scripts/cobbler-setup b/scripts/cobbler-setup
index 5ecdca7..198bd66 100755
--- a/scripts/cobbler-setup
+++ b/scripts/cobbler-setup
@@ -235,8 +235,6 @@ def setup_dns(answers):
if answers["enable_dns"]:
answers["dns_module"] = "manage_bind"
-
-
# =========================================================
@@ -396,7 +394,10 @@ def main():
setup_mirrors(answers)
copy_settings()
-
+ defaults = yaml.loadFile("/usr/share/cobbler/installer_templates/defaults").next()
+ for key in defaults.keys():
+ if key not in answers:
+ answers[key] = defaults[key]
# copy settings /before/ overwriting them
templatify("/usr/share/cobbler/installer_templates/settings.template",answers,"/etc/cobbler/settings")
templatify("/usr/share/cobbler/installer_templates/modules.conf.template",answers,"/etc/cobbler/modules.conf")
diff --git a/setup.py b/setup.py
index 26d7368..daf3b93 100644
--- a/setup.py
+++ b/setup.py
@@ -126,6 +126,7 @@ if __name__ == "__main__":
# templates for /usr/bin/cobbler-setup
(itemplates, ['installer_templates/modules.conf.template']),
(itemplates, ['installer_templates/settings.template']),
+ (itemplates, ['installer_templates/defaults']),
# kickstart dir
(vl_kick, []),
--
1.5.5.1
>From 24cefd5c902473adb96fac24df0c9b63c273c342 Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Fri, 19 Sep 2008 16:33:32 -0400
Subject: [PATCH] Corrected a space typo and added defaults to manifest
---
MANIFEST.in | 2 +-
installer_templates/settings.template | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MANIFEST.in b/MANIFEST.in
index 514775c..4e2e6bc 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -17,7 +17,7 @@ include config/completions
include config/cobbler_bash
include config/cheetah_macros
recursive-include templates *.template
-recursive-include installer_templates *.template
+recursive-include installer_templates *.template defaults
recursive-include kickstarts *.ks
recursive-include kickstarts *.seed
include docs/cobbler.1.gz
diff --git a/installer_templates/settings.template b/installer_templates/settings.template
index 96b838c..ac45af0 100644
--- a/installer_templates/settings.template
+++ b/installer_templates/settings.template
@@ -225,7 +225,7 @@ xmlrpc_rw_port: 25152
# this as 0. In that case, the cobbler mirrored yum repos are still
# accessable at http://cobbler.example.org/cblr/repo_mirror and yum
# configuration can still be done manually. This is just a shortcut.
-yum_post_install_mirror: $yum_post_install_mirror
+yum_post_install_mirror: $yum_post_install_mirror
# additional flags to yum commands
yumreposync_flags: "-l"
--
1.5.5.1
>From f7d0943487f625da469019ec391ae6f15d4b19b3 Mon Sep 17 00:00:00 2001
From: Partha Aji <paji(a)redhat.com>
Date: Fri, 19 Sep 2008 17:53:02 -0400
Subject: [PATCH] Added subprocess.call support
---
scripts/cobbler-setup | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/scripts/cobbler-setup b/scripts/cobbler-setup
index 198bd66..6be0ba7 100755
--- a/scripts/cobbler-setup
+++ b/scripts/cobbler-setup
@@ -31,11 +31,9 @@ import shutil
import os.path
import exceptions
-# FIXME: use subprocess.call() with shell=False instead
-# FIXME: check all return codes
import sys
import os
-
+import subprocess
try:
import readline
@@ -43,6 +41,11 @@ try:
except:
pass
+def execute(command, shell = False):
+ if subprocess.call(command, shell = shell) != 0:
+ sys.stderr.write(" -- ERROR: command '%s' failed executing. Exiting..\n" % command)
+ sys.exit(1);
+
class AnswerException(exceptions.Exception):
"""
Custom exceptions class so we only catch exceptions that we know are input related.
@@ -275,7 +278,6 @@ def setup_remote_config(answers):
"spacewalk" :"authn_spacewalk"
}
-
ask (answers,
"authn_module",
"Which authentication module do you want to use [%s] ?" % "/".join(translation.keys()),
@@ -284,7 +286,7 @@ def setup_remote_config(answers):
if answers['authn_module'] == 'authn_configfile':
print "* Updating cobbler user's password in user.digest file"
- os.system('htdigest -c users.digest Cobbler cobbler')
+ execute('htdigest -c users.digest Cobbler cobbler',shell=False)
print "* users can run 'htdigest /etc/users.digest Cobbler $username' later to add more users & change cobbler password"
translation = {
@@ -330,7 +332,7 @@ def ask(answers, key, question, params=None):
transformers = params.get("transformers",[]),
default = params.get("default",None),
required = params.get("required",True),
- max_len = params.get("max_len",True)
+ max_len = params.get("max_len",None)
)
answers[key] = answer
@@ -374,7 +376,7 @@ def main():
print "Setting up the Cobbler provisioning server."
print "http://fedorahosted.org/cobbler"
- os.system("rpm -q cobbler")
+ execute("rpm -q cobbler", shell = True)
print ""
print "if you have already configured cobbler, Ctrl+C now."
@@ -413,8 +415,8 @@ def main():
print "***********************************************"
print ""
- os.system("/sbin/service cobblerd restart")
- os.system("/sbin/service httpd restart")
+ execute("/sbin/service cobblerd restart", shell=True)
+ execute("/sbin/service httpd restart", shell=True)
print ""
print "***********************************************"
@@ -429,7 +431,7 @@ def main():
print ""
#print "Running cobbler check ..."
- os.system("cobbler check")
+ execute("cobbler check", shell=True)
print ""
print "***********************************************"
--
1.5.5.1
15 years, 7 months
Using mirror
by Miroslav Tomic
Hi to all members of this list!
I'm really new to Cobbler and trying to build up a stateless linux
server. Within my network infrastructure is a Fedora mirror that I mean
to use with Cobbler, if it's possible. I'm trying to understend the
concept and all the settings one must set in order to all that work.
First of all, it would be nice to see some guide on /etc/cobbler/setting
file, although many things are selfexplanatory I would still appreciate
some howto that would go into deep with all the possibilities. On the
other side, can i use somehow my existing Fedora mirror for cobbler
import? What I meant is to run a command like this:
cobbler import --mirror=/tmp/F9 --name=F9
--available-as=ftp://my.mirror.net/linux/fedora/releases/9/fedora/i386/
When this command is executed, all I get is:
----------- (adding distros)
----------- (associating kickstarts)
----------- (syncing)
If I run cobbler report afterwards, see nothing. Is this the way it
should be? The idea is to use existing mirror instead of copying data
onto server. Is this the way it should be done?
Thank you for your answer in advance!
15 years, 7 months
pxeboot fails to find rootfs created by livecd-iso-to-pxeboot
by sheng.zheng
hello
We are running cobbler-1.2.4-1 on RHEL5.2. Created initrd.img and
vmlinuz on another server(Fedora9) by livecd-iso-to-pxeboot command and
added the files as a distro to cobbler. All the steps are same as this
howto: https://fedorahosted.org/cobbler/wiki/HowToPxeAnyLiveCd
PXE can boot and download the big initrd.img but cannot find the rootfs.
Show me error like below:
---------------------
md: autorun ...
md: ... autorun DONE
VFS: Cannot open root device "Fedora-9-i686-Live.iso" or unknown-block(0,0)
Please append a correct "root=" boot option;here are the available
partitions:
0100 16384 ram0 (driver?)
0101 16384 ram1 (driver?)
0102 16384 ram2 (driver?)
...
...
...
010e 16384 ram14 (driver?)
010f 16384 ram15 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
----------------------
My pxelinux configuration file for the client created by cobbler:
/tftpboot/pxelinux.cfg/01-00-16-3e-aa-bb-cc
------------------
default linux
prompt 0
timeout 1
label linux
kernel /images/liveFedora9/Fedora9-i686-live-vmlinuz.img
append initrd=/images/liveFedora9/Fedora9-i686-live-initrd.img
rootflags=loop root=/Fedora-9-i686-Live.iso syslog=10.0.0.135:25150
rootfstype=iso9660 kssendmac
ks=http://10.0.0.135/cblr/svc/op/ks/system/testvm
-------------------
Any idea?
Thank you in advance
--Sheng
15 years, 7 months
dhpd.conf creation failure
by Greg Chavez
I'm working on an inherited cobbler server managing dhcp and dns. My
first attempt to add a server to cobbler for PXE boot and kickstart
failed, however, due to the following dhcp.conf generated after a
cobbler sync:
### /etc/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Tue Sep 16 20:45:14 2008)
# ******************************************************************
ddns-update-style none;
authoritative;
#ddns-update-style interim;
allow booting;
allow bootp;
option domain-name "xyz.testlab";
option domain-name-servers 192.168.13.211;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.110.0 netmask 255.255.254.0 {
option routers 192.168.110.240;
option subnet-mask 255.255.254.0;
# range dynamic-bootp 192.168.1.100 192.168.1.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.110.118;
option domain-name "xyz.testlab";
option domain-name-servers 192.168.13.211;
}
$insert_cobbler_system_definitions
###EOF
For some reason, the insert_cobbler_system_definitions variable is
being left as is. This prevents dhcpd from starting and even if I
remove it from the template, I am left without what I assume should be
my host definitions. Here also is our settings file:
###/etc/cobbler/settings
allow_duplicate_macs: 0
allow_duplicate_ips: 0
bind_bin: /usr/sbin/named
bootloaders:
ia64: /var/lib/cobbler/elilo-3.6-ia64.efi
standard: /usr/lib/syslinux/pxelinux.0
default_kickstart: /etc/cobbler/default.ks
default_virt_bridge: xenbr0
default_virt_type: xenpv
default_virt_file_size: 5
default_virt_ram: 512
default_ownership: "admin"
dhcpd_bin: /usr/sbin/dhcpd
dhcpd_conf: /etc/dhcpd.conf
dnsmasq_bin: /usr/sbin/dnsmasq
dnsmasq_conf: /etc/dnsmasq.conf
httpd_bin: /usr/sbin/httpd
http_port: 80
kernel_options:
ksdevice: eth0
lang: ' '
ldap_server: "ldap.example.com"
ldap_base_dn: "DC=example,DC=com"
ldap_port: 389
ldap_tls: 1
ldap_anonymous_bind: 1
ldap_search_bind_dn: ''
ldap_search_passwd: ''
ldap_search_prefix: 'uid='
manage_dhcp: 1
manage_dns: 1
next_server: '192.168.110.118'
omapi_enabled: 0
omapi_port: 647
omshell_bin: /usr/bin/omshell
pxe_just_once: 1
register_new_installs: 1
run_install_triggers: 1
server: 'manager.xyz.testlab'
snippetsdir: /var/lib/cobbler/snippets
syslog_port: 25150
tftpd_bin: /usr/sbin/in.tftpd
tftpd_conf: /etc/xinetd.d/tftp
webdir: /var/www/cobbler
xmlrpc_port: 25151
xmlrpc_rw_enabled: 1
xmlrpc_rw_port: 25152
yum_post_install_mirror: 0
yumdownloader_flags: "--resolve"
manage_forward_zones:
- 'xyz.testlab'
###EOF
Any guidance would be greatly appreciated.
--
--Greg Chavez
--
15 years, 7 months