Interesting issue with cobbler and EL-5
by Stephen John Smoogen
An interesting issue came up today with our RHEL-5 system running
cobbler. We had not built a system in a couple of days, and had not
seen any issues. Today of the systems could get tftp images from the
box. They kept getting permission denied. For some reason the files in
/tftpboot/images were 0600 (and directories 0700) which must have
worked last week but did not today. the reason is that the EL-5 tftpd
daemon gets the pxecfg.conf file as root but becomes nobody and could
not get any of the scripts below it. Changing the permissions to 0644
and 0755 fixed the issue.
Now why did it work last week? I don't know.. I can't see any config
file changes that would have allowed it to do so..
--
Stephen J Smoogen. -- BSD/GNU/Linux
How far that little candle throws his beams! So shines a good deed
in a naughty world. = Shakespeare. "The Merchant of Venice"
15 years, 7 months
[PATCH] cobbler: add enable-menu option to profiles (trac #234)
by James Cammarata
This patch is to add a new option to 'cobbler profile' (--enable-menu=[yes|no]) that will
allow the user to specify whether or not the profile should be added to the default
PXE boot menu. The reasoning behind this is, that with the addition of memtest and
rescue PXE images, there is a real chance that a user could select the wrong menu
option and destroy a system. Also, with large numbers of profiles listed in the menu, it
would be nice to be able to selectively trim some down.
This has also been added to /etc/cobbler/settings, to allow for a global default.
mdehaan mentioned this would need to be added to images as well, however I thought
I would do that as a separate patch (I do need to read up on images first...)
---
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 238e2cb..3b8525f 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -44,6 +44,7 @@ class Profile(item.Item):
self.name = None
self.owners = self.settings.default_ownership
self.distro = (None, '<<inherit>>')[is_subobject]
+ self.enable_menu = (self.settings.enable_menu, '<<inherit>>')[is_subobject]
self.kickstart = (self.settings.default_kickstart , '<<inherit>>')[is_subobject]
self.kernel_options = ({}, '<<inherit>>')[is_subobject]
self.kernel_options_post = ({}, '<<inherit>>')[is_subobject]
@@ -70,6 +71,7 @@ class Profile(item.Item):
self.name = self.load_item(seed_data,'name')
self.owners = self.load_item(seed_data,'owners',self.settings.default_ownership)
self.distro = self.load_item(seed_data,'distro')
+ self.enable_menu = self.load_item(seed_data,'enable_menu')
self.kickstart = self.load_item(seed_data,'kickstart')
self.kernel_options = self.load_item(seed_data,'kernel_options')
self.kernel_options_post = self.load_item(seed_data,'kernel_options_post')
@@ -148,6 +150,19 @@ class Profile(item.Item):
return True
raise CX(_("distribution not found"))
+ def set_enable_menu(self,enable_menu):
+ """
+ Sets whether or not the profile will be listed in the default
+ PXE boot menu. This is pretty forgiving for YAML's sake.
+ """
+ if type(enable_menu) == bool:
+ self.enable_menu = enable_menu
+ elif str(enable_menu).lower() in ["yes","y","on","1","true"]:
+ self.enable_menu = True
+ else:
+ self.enable_menu = False
+ return True
+
def set_dhcp_tag(self,dhcp_tag):
self.dhcp_tag = dhcp_tag
return True
@@ -232,6 +247,7 @@ class Profile(item.Item):
'name' : self.name,
'owners' : self.owners,
'distro' : self.distro,
+ 'enable_menu' : self.enable_menu,
'kickstart' : self.kickstart,
'kernel_options' : self.kernel_options,
'kernel_options_post' : self.kernel_options_post,
@@ -259,6 +275,7 @@ class Profile(item.Item):
buf = buf + _("parent : %s\n") % self.parent
else:
buf = buf + _("distro : %s\n") % self.distro
+ buf = buf + _("enable_menu : %s\n") % self.enable_menu
buf = buf + _("dhcp tag : %s\n") % self.dhcp_tag
buf = buf + _("kernel options : %s\n") % self.kernel_options
buf = buf + _("post kernel options : %s\n") % self.kernel_options_post
@@ -283,6 +300,7 @@ class Profile(item.Item):
'parent' : self.set_parent,
'profile' : self.set_name,
'distro' : self.set_distro,
+ 'enable_menu' : self.set_enable_menu,
'kickstart' : self.set_kickstart,
'kopts' : self.set_kernel_options,
'kopts-post' : self.set_kernel_options_post,
diff --git a/cobbler/modules/cli_profile.py b/cobbler/modules/cli_profile.py
index 8831b6e..acdff40 100644
--- a/cobbler/modules/cli_profile.py
+++ b/cobbler/modules/cli_profile.py
@@ -56,6 +56,7 @@ class ProfileFunction(commands.CobblerFunction):
p.add_option("--inherit", dest="inherit", help="inherit from this profile name, defaults to no")
if not self.matches_args(args,["find"]):
p.add_option("--in-place",action="store_true", dest="inplace", default=False, help="edit items in kopts, kopts_post or ksmeta without clearing the other items")
+ p.add_option("--enable-menu", dest="enable_menu", help="yes/no. When yes, adds profile to default PXE menu")
p.add_option("--kickstart", dest="kickstart", help="absolute path to kickstart template (RECOMMENDED)")
p.add_option("--ksmeta", dest="ksmeta", help="ex: 'blippy=7'")
p.add_option("--kopts", dest="kopts", help="ex: 'noipv6'")
@@ -108,6 +109,7 @@ class ProfileFunction(commands.CobblerFunction):
if not self.matches_args(self.args,["dumpvars","getks"]):
if self.options.inherit: obj.set_parent(self.options.inherit)
if self.options.distro: obj.set_distro(self.options.distro)
+ if self.options.enable_menu: obj.set_enable_menu(self.options.enable_menu)
if self.options.kickstart: obj.set_kickstart(self.options.kickstart)
if self.options.kopts: obj.set_kernel_options(self.options.kopts,self.options.inplace)
if self.options.kopts_post: obj.set_kernel_options_post(self.options.kopts_post,self.options.inplace)
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index 7d12d95..da33aaf 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -261,6 +261,9 @@ class PXEGen:
# build out the menu entries
pxe_menu_items = ""
for profile in profile_list:
+ if type(profile.enable_menu) == bool and not profile.enable_menu:
+ # This profile has been excluded from the menu
+ continue
distro = profile.get_conceptual_parent()
# xen distros can be ruled out as they won't boot
if distro.name.find("-xen") != -1:
diff --git a/cobbler/settings.py b/cobbler/settings.py
index b9356f6..b6e490e 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -44,6 +44,7 @@ DEFAULTS = {
"dhcpd_bin" : "/usr/sbin/dhcpd",
"dnsmasq_bin" : "/usr/sbin/dnsmasq",
"dnsmasq_conf" : "/etc/dnsmasq.conf",
+ "enable_menu" : 1,
"httpd_bin" : "/usr/sbin/httpd",
"http_port" : "80",
"isc_set_host_name" : 0,
diff --git a/config/settings b/config/settings
index 533f121..887f585 100644
--- a/config/settings
+++ b/config/settings
@@ -43,6 +43,11 @@ default_virt_ram: 512
# owner and/or group. Can be a comma seperated list.
default_ownership: "admin"
+# if 1, cobbler will add the profile entry to the default
+# PXE boot menu. This can be over-ridden on a per-profile
+# basis when adding/editing profiles
+enable_menu: 1
+
# location for some important binaries and config files
# that can vary based on the distribution.
dhcpd_bin: /usr/sbin/dhcpd
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
15 years, 7 months
For whatever reason, 1.2.0 is on the Fedora mirrors
by Michael DeHaan
I have since submitted lots of 1.2.X upgrades, but if you are installing
cobbler via yum and have version x<=2, you're going to get 1.2.0, which
is the version with the merge conflict in it. Fedora updates were just
re-enabled.
This has already been brought up on the list, but I'm posting this here
for new folks.
The fix is to install the latest from here.
http://people.fedoraproject.org/~mdehaan/files/cobbler/
1.2.4 should be going out when it goes out. It's already submitted so
I'm just waiting on the next push.
--Michael
15 years, 7 months
Problem with kickstart templating and variables
by Tim Verhoeven
Hi,
I've got a problem with cobbler (1.2.4) with the kickstart templating
using cheetah and the use of variables in included files. This used to
work (in pre 1.0 cobbler versions). This is the code in the kickstart
file itself :
#set $loc = $getVar("loc","defaultplace")
#if $loc == "defaultplace"
SNIPPET::varsdefault
#else if $loc == "otherplace"
SNIPPET::varsotherplace
#end if
This is how such a snippet looks like :
# Variables specific for the setup in default loc
#set $dns1 = "X.X.X.X"
#set $dns2 = "X.X.X.X"
#set $nfsserver = "X.X.X.X"
#set $ntp = "hostname.domain"
#set $smtp = "hostname.domain"
#set $funcserver = "hostname.domain"
But using these variables inside the main kickstart or other snippets
does not work, they are not replaced and stay as they are in the
original files. For example :
echo "nameserver $dns2" >> /etc/resolv.conf
Stays exactly like that in the rendered kickstart file for the host in question.
As a test I replace the line "SNIPPET::varsotherplace" by "#include
'/var/lib/cobbler/snippets/varsotherplace'". But that did not change
the result.
Anyone any idea what is going on here ? I've looked that the changes
on the wiki but I did not see anything like this.
Thanks,
Tim
--
Tim Verhoeven - tim.verhoeven.be(a)gmail.com - 0479 / 88 11 83
Hoping the problem magically goes away by ignoring it is the
"microsoft approach to programming" and should never be allowed.
(Linus Torvalds)
15 years, 8 months
pxe menu and kickstart files
by Marcelo Giles
Hello,
I'm running cobbler 1.0.3-1.el5 on RHEL 5.2.
When I try to PXE boot a client with a profile that has defined a
kickstart file, the client can't read the kickstart file and shows the
manual configuration screens.
This is the cobbler report list kickstart line:
# cobbler profile report profile1
kickstart : /data/ks/rhel51.cfg
And this is the kernel option line in the /tftpboot/pxelinux.cfg/default
file:
ks=http://192.168.0.252/cblr/svc/op/ks/profile/profile1
I can't find the /cblr/svc/op/ks/profile/ path in the system.
I created a symlink in /var/www/html/cblr -> /var/www/cobbler to see if
that was the missing path, but the svc dir only has three python files
and no subdirs! Any clues? TIA.
Regards,
Marcelo
15 years, 8 months
More on Reports
by Anderson Silva
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've changed commands.py so cobbler {system,repo,profile,etc} report
will work using action_report.py.
I've also cleared up some of the code from the previous patches.
Here is the current functionality available:
[root@bean2test cobbler]# cobbler system report
{'name': None}
system : local_re_redhat_com
profile : RHEL-5-Server-U2-xen-x86_64
kernel options : {}
kickstart : <<inherit>>
ks metadata : {}
netboot enabled? : True
owners : ['admin']
server : <<inherit>>
virt cpus : <<inherit>>
...
The above only supports the standard output right now.
[root@bean2test cobbler]# cobbler report --what=profiles --type=trac
- --fields=name,parent
||name||parent||
||RHEL-4-AS-U7-i386||||
||RHEL-4-AS-U7-x86_64||||
||RHEL-4-AS-U7-x86_64-pobox||||
||RHEL-4-AS-U7-xen-i386||||
||RHEL-4-AS-U7-xen-x86_64||||
||RHEL-4-AS-latest-i386||RHEL-4-AS-U7-i386||
||RHEL-4-AS-latest-x86_64||RHEL-4-AS-U7-x86_64||
||RHEL-4-AS-latest-xen-i386||RHEL-4-AS-U7-xen-i386||
||RHEL-4-AS-latest-xen-x86_64||RHEL-4-AS-U7-xen-x86_64||
One, thing that I am finding a bit confusing, and I'd like some feedback
on is that:
The fact that you can do:
cobbler system report
and
cobbler report --what=systems
Note that plural/singular difference, makes it a bit hard to remember
(at least for me), even though it makes sense if you stop to think about
what you doing.
Do we want to make the code handle --what=system and systems
interchangebily (? spelling) or leave as is?
I hope to have a *new* working patch by the end of the week.
AS
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFIxrh4ECmX3C4JWKgRAqQzAKCBWTZxMJnn1BNMiaUUbj4zg8iFqwCcC+/r
q+1wnqvsTqwiNy1vphjnAhk=
=257q
-----END PGP SIGNATURE-----
15 years, 8 months