(devel) Do you have a remote git branch?
by Michael DeHaan
Func has been keeping a page of remote git branches, and I generally
find that useful, so I have added a list of folks with remote git
branches here:
https://fedorahosted.org/cobbler/wiki/PeopleWithRemoteGitBranches
If you like git, this is (generally) easier than patches once set up, so
I would encourage hosting a branch if you feel like it. That's totally
optional, but does ensure names get preserved in the changelogs and such
(you'll be more famous), and it makes for nicer "gitk" output.
--Michael
15 years, 6 months
(devel) passing environment variables to rsync and/or reposync
by Michael DeHaan
New minor feature:
"cobbler repo add" now takes an optional --environment that can be used
to pass arbitary environment variables to a repo before it is called
with "cobbler reposync".
Example:
cobbler repo add --name=foo --mirror=rsync://server/contents
--environment="foo1=bar2 foo2=bar2"
Rsync offers several parameters up via environment variables:
CVSIGNORE
The CVSIGNORE environment variable supplements any ignore patterns in
.cvsignore
files. See the --cvs-exclude option for more details.
RSYNC_ICONV
Specify a default --iconv setting using this environment variable.
RSYNC_RSH
The RSYNC_RSH environment variable allows you to override the default
shell used
as the transport for rsync. Command line options are permitted after the
com-
mand name, just as in the -e option.
RSYNC_PROXY
The RSYNC_PROXY environment variable allows you to redirect your rsync
client to
use a web proxy when connecting to a rsync daemon. You should set
RSYNC_PROXY to
a hostname:port pair.
RSYNC_PASSWORD
Setting RSYNC_PASSWORD to the required password allows you to run
authenticated
rsync connections to an rsync daemon without user intervention. Note
that this
does not supply a password to a remote shell transport such as ssh; to
learn how
to do that, consult the remote shell’s documentation.
USER or LOGNAME
The USER or LOGNAME environment variables are used to determine the default
username sent to an rsync daemon. If neither is set, the username
defaults to
“nobody”.
HOME The HOME environment variable is used to find the user’s default
.cvsignore
file.
Additionally yum may in the future care about this, so I've added this
feature in such a way we can pass environment variables to yum as well.
--Michael
15 years, 6 months
Why did cobbler name my distro/profile centos-5.2-centos-5.2-x86_64?
by Chris O'Regan
I imported CentOS like so:
cobbler import \
--mirror=rsync://rsync.arcticnetwork.ca/centos/5.2/os/x86_64/ \
--arch=x86_64 \
--name=centos-5.2
It fetched everything and put it in:
/local/data/cobbler/www/ks_mirror/centos-5.2-x86_64
Yet when it decided to name my distro and profile, it tacked on and
extra "centos-5.2":
[...]
---------------- (adding distros)
- creating new distro: centos-5.2-centos-5.2-x86_64
- creating new profile: centos-5.2-centos-5.2-x86_64
- creating new distro: centos-5.2-centos-5.2-xen-x86_64
- creating new profile: centos-5.2-centos-5.2-xen-x86_64
[...]
I prefer "centos-5.2-x86_64" and "centos-5.2-xen-x86_64". Why would it
name it in this manner? Did I invoke the import incorrectly?
This is v2.8.0.
Thanks,
Chris
15 years, 6 months
Reminder: Has anyone /not/ changed the default passwords in your kickstarts?
by Michael DeHaan
As you are probably aware the sample kickstarts contain a default
password of "cobbler".
Cobbler check will warn you if any kickstarts use this password.
# "cobbler check"
If you have any kickstarts using this password, you should change them.
If you have any systems that might be using those passwords already
installed, you should change them.
A future idea for /usr/bin/cobbler setup is probably to ask the user
what they want the default password for the sample kickstarts to be and
then add that to the sample kickstarts.
--Michael
15 years, 6 months
Duplicate repo supression patch (master+devel branches)
by Michael DeHaan
It appears that having duplicate entries for the same repo in a
kickstart file can crash /some/ versions of Anaconda. This can
sometimes happen with cobbler imports, when it includes a part of an
installation tree more than once. For instance, RHEL trees are split
into many subtrees, so import has to make them each into yum repos so
that they can be installed from kickstart. However, if we include each
of these subtrees twice, that can be a problem. Naturally, we
shouldn't be including them twice, but this is about fixing that for all
imports in the past and not asking folks to re-import, as that would be
a pain.
(This is when I explain that install trees are more than just repos,
they contain data usable as repos once createrepo is run on them, but
it's important to remember that "cobbler import" is for install trees
and "cobbler repo add" is for regular repos like updates, extra package
repos, EPEL, and so forth)
Anyway, I've made a fix for this on both branches of Cobbler, but
there's no real need to apply this unless you're seeing problems with
Anaconda tracebacks. So far I have heard about this in RHEL 5.1, but
only just this week -- it's not a new problem, it's just that likely in
most cases Anaconda tolerates this and doesn't care.
Seeing I felt like being paranoid, I also added a check to make sure the
same repo doesn't ever appear in yum twice, for example if
yum_post_install_mirror was enabled in settings (to allow packages not
yet in updates to be used on installed systems without mirroring the
"everything" tree, for instance). So there is now some duplicate
supression there too. Yum shouldn't care itself though.
Here's the patch:
http://git.fedorahosted.org/git/cobbler?p=cobbler;a=commitdiff;h=077ee6fc...
--Michael
15 years, 6 months
(devel) [PATCH] Added a pre_install_network_config snippet
by Jasper Capel
Hey,
I added a pre_install_network_config snippet, which is a bit similar to
the disk-configuration-management:
The pre-install code gets the information from cobbler, and it writes
some bash code to match the right IP to the right network interface as
seen by anaconda. This bash code writes the "network" statements, which
are included in the normal installation section of the kickstart.
This only makes sense if MAC-addresses are recorded in Cobbler for all
physical network interfaces. If this is not the case, the network_config
snippet (which I slightly modified, again) falls back to the old behaviour.
This should fix any NIC enumeration problems discussed before, and make
sure the arbitrary interface names code works like it should (i.e. not
mix up your interfaces).
git://bender.newnewyork.nl/cobbler (branch: networking)
http://bender.newnewyork.nl/git/gitweb.cgi?p=cobbler/.git;a=commit;h=1ccf...
In this branch, I also added this code to sample.ks.
# Start pre_install_network_config generated code
An example of the bash code generated:
# Start of code to match cobbler system interfaces to physical
interfaces by their mac addresses
# Start blub.11
# Skipping (not a physical interface)...
# Start eth0.10
# Skipping (not a physical interface)...
# Start blub
# Skipping (no configuration)...
# Start eth0
# Configuring eth0 (00:0C:29:99:81:BD)
if ifconfig | grep -i 00:0C:29:99:81:BD
then
IFNAME=$(ifconfig | grep -i '00:0C:29:99:81:BD' | cut -d " " -f 1)
echo "network --device=$IFNAME --bootproto=static --ip=10.0.8.250
--netmask=255.255.255.0 --gateway=10.0.8.254" >>
/tmp/pre_install_network_config
fi
Which is included in the normal section of the kickstart:
# Network information
# Using "new" style networking config, by matching networking
information to the physical interface's
# MAC-address
%include /tmp/pre_install_network_config
--Jasper
15 years, 6 months
(devel) A note about unit tests moving forward
by Michael DeHaan
Mistakenly first posted to fedora-devel (doh!)...
I've switching "make test" to call unit tests via nose, which produces
some nicer output from the same test code.
To get nose, you'll need to:
# yum install nose
Nose can also be called with coverage if you uncomment that part of the
Makefile.
# easy_install coverage
While currently a lot of tests exist in tests/test.py the intent is for
new tests to live with the code, so that they have a greater hope of
being maintained when folks add features (since they will obviously be
in the same file).
For instance, XMLRPC tests will live in remote.py.
Nose allows for tests to be named "test_something" and it will find
functions of that form and see if any asserts in them fail.
For instance:
assert x == 2, "verify that the return code is two"
Another nice feature of nose is that when running "make test" the output
is a lot nicer, it will only show stdout/stderr for tests that actually
fail, so there's a lot less noise to sift through.
--Michael
15 years, 6 months
track minor version in os_version
by Bill Peck
>From b6683d73589550486563946985416d596a59b637 Mon Sep 17 00:00:00 2001
From: Bill Peck <bpeck(a)localhost.localdomain>
Date: Thu, 16 Oct 2008 11:44:35 -0400
Subject: [PATCH] track minor number in os_version
Also update kickstart search to look for minor version first
---
cobbler/action_import.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index ada238d..d741b08 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -941,17 +941,21 @@ class RedHatImporter ( BaseImporter ) :
os_version = "rhel2.1"
else:
try:
- os_version = "rhel%s" % int(major)
+ os_version = "rhel%s.%s" % (int(major), int(minor))
except:
os_version = "other"
kickbase = "/var/lib/cobbler/kickstarts"
- # Look for ARCH/OS_VERSION kickstart first
+ # Look for ARCH/OS_VERSION.MINOR kickstart first
+ # ARCH/OS_VERSION next
# OS_VERSION next
+ # OS_VERSION.MINOR next
# ARCH/default.ks next
# default.ks finally.
- kickstarts = ["%s/%s/%s.ks" % (kickbase,distro.arch,distro.os_version),
+ kickstarts = ["%s/%s/%s.ks" % (kickbase,distro.arch,distro.os_version]),
+ "%s/%s/%s.ks" % (kickbase,distro.arch,distro.os_version.split('.')[0]),
"%s/%s.ks" % (kickbase,distro.os_version),
+ "%s/%s.ks" % (kickbase,distro.os_version.split('.')[0]),
"%s/%s/default.ks" % (kickbase,distro.arch),
"%s/default.ks" % kickbase]
for kickstart in kickstarts:
--
1.5.5.1
15 years, 6 months
Using template rendering in cobbler devel
by Charles Duffy
Howdy, 'yall. I'm having some trouble using the new templating support
in the devel branch (77f5e38b097e79d5d0de3e994dad54f381bb706f).
$ BASEURL=http://localhost/cblr/svc/op/template
$ cobbler profile edit \
> --name=CentOS-5.1-x86_64 \
> --template-files=/local/templates/racadm.ini=racadm.ini
$ cobbler sync
$ cobbler system dumpvars --name=00:16:3e:67:2b:43 | grep template_files
'template_files': {'/local/templates/racadm.ini': 'racadm.ini'},
$ curl ${BASEURL}/system/00:16:3e:c9:95:47/path/racadm.ini
# template path not found for specified profile
$ curl ${BASEURL}/profile/CentOS-5.1-x86_64/path/racadm.ini
# template path not found for specified profile
Since we're checking in cobbler.api for template_results.has_key(path),
I made the error a bit more verbose, printing path.keys() as part of the
error message, and attempting other variants:
$ curl ${BASEURL}/system/00:16:3e:c9:95:47/path/racadm.ini
# template path not found for specified system (options: [])
$ curl ${BASEURL}/profile/CentOS-5.1-x86_64/path/racadm.ini
# template path not found for specified profile (options:
['/var/www/cobbler/rendered/racadm.ini'])
$ curl
${BASEURL}/profile/CentOS-5.1-x86_64/path//var/www/cobbler/rendered/racadm.ini
# template path not found for specified profile (options: [])
$ curl
${BASEURL}/profile/CentOS-5.1-x86_64/path/_var_www_cobbler_rendered_racadm.ini
# template path not found for specified profile (options: [])
Any hints/pointers?
15 years, 6 months