Terminology suggestions
by Alan Evangelista
I see some terms used in Cobbler which were probably created a long time
ago and are
currently outdated. I'd like to suggest renamings which would make names
reflect better
current code. Examples:
- "kickstart" is commonly used in Cobbler to refer to the file which is
used by Linux installers
to automate Linux installation and configuration. Cobbler supports
Debian, Suse and Red Hat based
distros. However, "kickstart" term is exclusive to Red Hat based
distros, Suse based distros use
"autoyast" and Debian based distros use "preseed". A generic term (eg
auto-installation file)
would prevent confusion.
- BootAPI and BootCLI are not intuitive names. It seems Cobbler is
limited to managing network
boot. I think CobblerAPI and CobblerCLI are better names.
- I'd expect that PXEGen class would handle all PXE (DHCP + TFTP) files.
However, it builds mainly
boot loader configuration files and files which will be copied to TFTP
server in a Cobbler server,
it does not build DHCP conf file. Also, Cobbler currently support archs
which do not use PXE,
such as Power. I'd rename this to TFTPGen.
- Config class manages collections of Cobbler objects (system, profile,
distro, etc.). Config is
already used in several different contexts in Cobbler, such as Cobbler
config file, DHCP config file,
boot loader config file, etc. It takes a while to figure out that
system/profile/distro data created
by user is maintained by this class. I think that CollectionManager or
something similar would be more
intuitive.
- cobbler/modules/serializer_catalog.py serializes/deserializes objects
to/from files. Catalog is a
generic term which does not add much. Renaming to serializer_file would
make this much easier to understand.
I have already implemented most of these changes in my customized
Cobbler. If the ideas are welcome,
I could apply them in upstream code and submit patches.
Regards,
Alan Evangelista
9 years, 6 months
web directory clean-up
by J's Mail
I'm mounting /var/www/cobbler from NFS. It's Netapp, so there's a
'.snapshot' directory. 'cobbler sync' wants to remove/clean-up this
directory. Nothing happens, as .snapshot is read-only, but there's a
noticable delay as the command runs.
At first blush, the change is simple: whitelist the directory in
action_sync.py. However, I'm not a fan of this approach because a version
upgrade could lose this change. More preferable, I believe, would be a
file with whitelisted directories. Thoughts?
Finally, thanks for all the hard work; it's great software.
-- Jess
9 years, 6 months
Just out of curiosity...
by Michael Tiernan
i got asked a question that I didn't know the answer to. It's a
philosophical one I suppose.
The back end of cobbler has the ability to use MySQL as a storage facility.
The question I got asked was why not SQLite? Wouldn't that be easier
than MySQL?
Opinions?
9 years, 7 months
Fine grained ACL
by Alan Evangelista
To support our custom access control, we have implemented fine grained
ACL (access control list)
in Cobbler, specific to each Cobbler object (distro, profile, system,
etc). Each entry of this ACL
may be associated with a user ou a group of users. ACL entry format is:
member_type (user/group),
member_name, permission. Required implementation changes:
- wrap kickstart/snippet into an Item
- add new 'acl' field to all item types (distro, profile, system,
repo, package, file, mgmtclass, image, kickstart, snippet)
- support ACL edition in a new tab in all item types in Cobbler web UI
We have not implemented group management in Cobbler web UI because we do
not need,
but it could be easily done by someone else.
Cobbler community has interest in this feature?
Regards,
Alan Evangelista
9 years, 7 months
Generation of OS installation statistics
by Alan Evangelista
We have developed code to generate statistics about OS installation in a
Cobbler server
and save it in a relational database. For each system and date/time when
netboot was enabled,
it saves user, target system name, target Linux distribution name,
date/time when netboot
was enabled, date/time when system was restarted via Cobbler, date/time
when system network
configuration was requested to DHCP server, date/time of boot
loader/kernel download via TFTP
and date/time of automated OS installation end (if user used Cobbler's
default
kickstart/autoyast/preseed).
Our setup saves to a MySQL database, but this could be abstracted to use
any relational database.
The code assumes there is a DHCP and TFTP server installed locally in
Cobbler server, as it
parses DHCP/TFTP local logs. Code works independently of user restarting
system manually or
via Cobbler.
Cobbler community has interest in this feature?
Regards,
Alan Evangelista
9 years, 7 months
Templated scripts
by Alan Evangelista
I'd like to understand better the purpose of the generic templated
scripts available in the
scripts directory in Cobbler repository. The script() method in
cobbler/services.py seems
to be the responsible for creating these and, according to
documentation, the purpose
is to generate scripts based on snippets useful for post or late action
where it
is difficult to embed the script in the kickstart/autoyast/preseed file.
I see only two
of those in upstream Cobbler: preseed_early_default and
preseed_late_default.
These scripts only include snippets and are only used in sample preseed
available
in kickstarts/ directory. I dont understand why these 2 scripts could
not be embedded
directly in the sample preseed.
Is anyone using this feature?
Regards,
Alan Evangelista
9 years, 7 months
Bug introduced by 74bda5972fff ("More refactoring around input validation."
by Nishanth Aravamudan
This commit (afaict, not bisected, as I'm trying to get my server up &
running) broke the web UI. It removed the "<<inherit>>" entry from the
dropdown for systems' kickstarts. The default became "" (added in a
separate commit) -- but then provided no means to set the kickstart as
inherited again.
The simple change below
--- a/web/cobbler_web/views.py
+++ b/web/cobbler_web/views.py
@@ -1108,6 +1108,7 @@ def generic_edit(request, what=None, obj_name=None, editmode="new"):
# allow for an empty value in the webui
kickstart_list = remote.get_kickstart_templates()
kickstart_list.append("")
+ kickstart_list.append("<<inherit>>")
kickstart_list.sort()
# populate some select boxes
got me working again, but seems like a workaround possibly for something
not expexpected.
Just an FYI, these "refactoring" changes seem like they are also
changing functionality -- dunno if that's ideal, it would be nice if the
commits were a bit more split up. But I appreciate all the improvements
I'm seeing!
-Nish
9 years, 7 months
Bug introduced by eb3c8d35c481 (Get rid of deprecated "bonding" field")
by Nishanth Aravamudan
With this commit applied, I get the following error when trying to
render snippets/post_install_network_config_deb as invoked by
sample.preseed:
Thu Aug 28 16:34:19 2014 - INFO | generate_script
Thu Aug 28 16:34:19 2014 - ERROR |
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# need more than 1 value to unpack
# File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 204, in render_cheetah
# data_out = t.respond()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_45_92467.py", line 127, in respond
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_45_92467.py", line 70, in __errorCatcher1
#
# File "<string>", line 1, in <module>
#
# File "/usr/lib/python2.7/site-packages/cobbler/template_api.py", line 173, in SNIPPET
# result = BuiltinTemplate.SNIPPET(self, file)
#
# File "DynamicallyCompiledCheetahTemplate.py", line 88, in SNIPPET
#
# File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1615, in _handleCheetahInclude
# self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_65_55359.py", line 438, in respond
#
Thu Aug 28 16:34:19 2014 - INFO | Exception occured: <class 'cobbler.cexceptions.CX'>
Thu Aug 28 16:34:19 2014 - INFO | Exception value: 'Error templating file, check cobbler.log for more details'
Thu Aug 28 16:34:19 2014 - INFO | Exception Info:
File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 2154, in _dispatch
return method_handle(*params)
File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 1121, in generate_script
return self.api.generate_script(profile, system, name)
File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 701, in generate_script
return self.pxegen.generate_script("system", system, name)
File "/usr/lib/python2.7/site-packages/cobbler/pxegen.py", line 1102, in generate_script
return self.templar.render(template_data, blended, None, obj)
File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 112, in render
data_out = self.render_cheetah(raw_data, search_table, subject)
File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 211, in render_cheetah
raise CX("Error templating file, check cobbler.log for more details")
The following changes let the templating succeed:
diff --git a/snippets/post_install_network_config b/snippets/post_install_network_config
index 2b0e57c..8dcced7 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -173,7 +173,7 @@ cat >> $devfile << EOF
BONDING_OPTS="$bonding_opts"
EOF
#end if
- #elif $iface_type in ("bond_slave") and $iface_master != ""
+ #elif $iface_type == "bond_slave" and $iface_master != ""
echo "SLAVE=yes" >> $devfile
echo "MASTER=$iface_master" >> $devfile
echo "HOTPLUG=no" >> $devfile
diff --git a/snippets/post_install_network_config_deb b/snippets/post_install_network_config_deb
index c135ecb..697a3dd 100644
--- a/snippets/post_install_network_config_deb
+++ b/snippets/post_install_network_config_deb
@@ -97,7 +97,7 @@ echo "auto $iname" >> /etc/network/interfaces
## ===================================================================
#if $iface_type in ("bond","bonded_bridge_slave")
#pass
- #elif $iface_type in ("bond_slave") and $iface_master != ""
+ #elif $iface_type == "bond_slave" and $iface_master != ""
#pass
#elif $iface_type == "bridge"
#set $slave_ports = " ".join($bridge_slaves.get($iname,[]))
@@ -124,7 +124,7 @@ echo " netmask $netmask" >> /etc/network/interfaces
echo " mtu $mtu" >> /etc/network/interfaces
#end if
#end if
- #if $ip == "" and $iface_type in ("bond") and $is_vlan == "false"
+ #if $ip == "" and $iface_type == "bond" and $is_vlan == "false"
echo "iface $iname inet manual" >> /etc/network/interfaces
#set $bondslaves = ""
#for $bondiname in $ikeys
@@ -156,7 +156,7 @@ echo " mtu $mtu" >> /etc/network/interfaces
#if $netmask != ""
echo " netmask $netmask" >> /etc/network/interfaces
#end if
- #if $iface_type in ("bond")
+ #if $iface_type == "bond"
#set $bondslaves = ""
#for $bondiname in $ikeys
#set $bondidata = $interfaces[$bondiname]
@@ -177,7 +177,7 @@ echo " bond-$bondkey $bondvalue" >> /etc/network/interfaces
echo "iface $iname inet manual" >> /etc/network/interfaces
#end if
#end if
- #if $iface_type in ("bond_slave") and $iface_master != ""
+ #if $iface_type == "bond_slave" and $iface_master != ""
echo "bond-master $iface_master" >> /etc/network/interfaces
#end if
#if $enableipv6 == True and $ipv6_autoconfiguration == False
Thanks,
Nish
9 years, 7 months