How do you modify cobbler to send two email messages?
by Paul Company
I'm trying to modify cobbler so it sends out two emails after a
successful install.
Here's what I did to try to accomplish this - but it didn't work.
I get the first (default) email, but I don't get the second email.
Any ideas.
# vi /etc/cobbler/reporting/build_my_report_email.template
From: $from_addr
To: pcompany(a)mydomain.com
Subject: "Installed bar.baz.mydomain.com"
USER=($user)
NEWHOST=[$system_name]
:wq!
# vi /usr/lib/python2.4/site-packages/cobbler/modules/install_post_report.py
## I added the following to the bottom of this file, before the "return 0"
input_template = open("/etc/cobbler/reporting/build_my_report_email.template")
input_data = input_template.read()
input_template.close()
message = templar.Templar().render(input_data, None, None)
server_handle = smtplib.SMTP(smtp_server)
server_handle.sendmail(from_addr, "pcompany(a)mydomain.com", message)
server_handle.quit()
:wq!
14 years, 7 months
/etc/dhcpd.conf -> /etc/dhcp.conf on upgrading cobbler 1.6.x to 2.0
by Christian Horn
Hi,
sorry if this has been discussed, but havent seen
something related here on @users:
upgrading 1.6 to 2.0 i used the new /etc/cobbler/settings
file, just customized 5 things over the default contents.
Apparently dhcpd_conf is no longer in the settings-file
and dhcpd.conf is templated to /etc/dhcp.conf .
dhcpd of rhel5 still expects dhcpd.conf, using a symlink now.
Using a different config-file in /etc/sysconfig/dhcpd is also
possible.
Was that by intention, is something broken with the setup
here? Seen it on the first 2 of a dozen cobbler-slaves we
plan to migrate to 2.0.
2.0 feels really faster in some places, our existing snippets
for rhel and sles do not seem broken, thanks for
the release :)
Christian
14 years, 7 months
Reminder: Is your bug listed in Trac?
by Michael DeHaan
Hi folks,
Thanks for sticking with us last week. I'll be fixing lots of Cobbler
2.0 bugs this week with the intent on getting a 2.0.1 release together
for testing, and, if all goes as planned, pushing to the stable repos.
If you have mentioned a bug, and it's not in Trac, you need to make sure
it is there so we make sure the item in question is fixed, or at least,
read -- some minor bugs will likely get fixed in a later release, but
we'll hit the big ones for 2.0.1. Right now it looks
like some things mentioned are not in Trac -- I'll try to make sure all
major items are dealt with, but having a bug
open is the best way to go to make sure we don't lose track [sic] of the
item.
To get a Trac account visit:
https://admin.fedoraproject.org/accounts
Then visit
http://fedorahosted.org/cobbler
(if your ticket isn't in the list of tickets, click login, then click
"new ticket")
Thanks!
--Michael
14 years, 7 months
2.0 prevents kopts from being removed
by Christopher Johnston
Behavior on 1.6.x allows you to zero out any params as part of a kopt. I
noticed in 2.0 I can append more entries but cant remove the existing ones
or remove all of them. Also is kopts-post even valid anymore? I don't see
it printed when looking at a system report, but I see it in the json file.
If the usual CLI sequence that I am used to is different now please feel
free to chime in.
# cobbler system edit --name=host --kopts="debug=1"
# cobbler system report host | grep options
kernel options : {'debug': '1'}
kernel options post : {}
# cobbler system edit --name=host --kopts=""
# cobbler system report host | grep options
kernel options : {}
kernel options post : {}
2.0 behavior:
# cobbler system report --name=host | grep Kernel
Kernel Options : {'igb.LLISize': '128', 'igb.LLIPush': '1',
'mtos_nic': '1', 'pinirq': '1'}
# cobbler system edit --name=host --kopts=''
# cobbler system report --name=host | grep Kernel
Kernel Options : {'igb.LLISize': '128', 'igb.LLIPush': '1',
'mtos_nic': '1', 'pinirq': '1'}
14 years, 7 months
Cobbler 2.0 startup error.
by Jeremy Rosengren
I just installed Cobbler 2.0 on a server that was running 1.6.6 and am
seeing the following error:
[root@srvr ~]# service cobblerd start
Starting cobbler daemon: Traceback (most recent call last):
File "/usr/bin/cobblerd", line 76, in main
api = cobbler_api.BootAPI(is_cobblerd=True)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 117, in
__init__
self.deserialize()
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 678, in
deserialize
return self._config.deserialize()
File "/usr/lib/python2.4/site-packages/cobbler/config.py", line 208, in
deserialize
serializer.deserialize(self._systems)
File "/usr/lib/python2.4/site-packages/cobbler/serializer.py", line 122,
in deserialize
rc = storage_module.deserialize(obj,topological)
File
"/usr/lib/python2.4/site-packages/cobbler/modules/serializer_catalog.py",
line 189, in deserialize
obj.from_datastruct(datastruct)
File "/usr/lib/python2.4/site-packages/cobbler/collection.py", line 153,
in from_datastruct
self.add(item)
File "/usr/lib/python2.4/site-packages/cobbler/collection.py", line 234,
in add
ref.check_if_valid()
File "/usr/lib/python2.4/site-packages/cobbler/item_system.py", line 527,
in check_if_valid
raise CX("profile is required")
CX: 'profile is required'
[ OK ]
I have a very simple configuration, as I mainly use cobbler to do
non-kickstart PXE installs and therefore don't have any systems defined.
Thanks,
-- jeremy
14 years, 7 months
koan builds a Xen domU; where did it go?
by Dick Davies
Hi I've figured out (I think) xen networking at last, and can now
build guests with
koan.
I used this command line on the dom0:
koan --system=indra --virt --nogfx
(see attachment for full output).
The install works as any other Cobbler-based PXE kickstart (I can
watch it with 'virsh console indra', but when the domain
reboots (after the install) it disappears, and I can't find it!
It doesn't show up in 'xm list' or 'virsh list'
There's an 'error' in the koan output:
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByUUID
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName
but I'm assuming that's libvirt not being able to find the domain,
because it doesn't exist yet.
14 years, 7 months
cobbler 2.0 XMLRPC problem/question
by Derek T. Yarnell
A while back I had used the example Perl in the wiki to get my toes
wet into talking XMLRPC to cobbler. All was going well in 1.6.x and
then since we haven't deployed the system I though hey I will go to
2.0 so i have less pain later!
Anyway this code,
use XMLRPC::Lite;
# Build the connection
my $xmlrpc = XMLRPC::Lite->proxy($uri);
# Login to cobbler xmlrpm and get session token back.
my $token = $xmlrpc->login($user, $password)->result();
# Create new system object
my $object = $cobbler->new_system($token)->result();
$cobbler->modify_system($object, "name", $hostname, $token)->result();
$cobbler->modify_system($object, "hostname", $hostname, $token)->result
();
$cobbler->modify_system($object, "profile", $profile, $token)->result();
$cobbler->modify_system($object, "gateway", $gateway, $token)->result();
###
my %eth0 = (
"macaddress-eth0" => $mac,
"ipaddress-eth0" => $ip,
"static-eth0" => 1,
"subnet-eth0" => $netmask,
);
$cobbler->modify_system($object, "modify-interface", \%eth0, $token)-
>result();
# Commit the system object
my $result = $cobbler->save_system($object, $token)->result();
Created a host with the code, and the cobbler.log shows nothing bad,
Thu Sep 24 17:02:38 2009 - INFO | authenticate; ['derek', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE new_item(system); user(derek)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek', 'new_system',
None, None, True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE modify_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==); attribute(name)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek',
'modify_system', <cobbler.item_system.System instance at 0x727ec20>,
'name', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE modify_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==); attribute(hostname)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek',
'modify_system', <cobbler.item_system.System instance at 0x727ec20>,
'hostname', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE modify_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==); attribute(profile)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek',
'modify_system', <cobbler.item_system.System instance at 0x727ec20>,
'profile', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE modify_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==); attribute(gateway)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek',
'modify_system', <cobbler.item_system.System instance at 0x727ec20>,
'gateway', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE modify_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==); attribute(modify-interface)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek',
'modify_system', <cobbler.item_system.System instance at 0x727ec20>,
'modify-interface', True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | REMOTE save_item(system); user
(derek); object_id(___NEW___system::
3TOmCVq3auSpmKAFRcwApSaOIZV2Plmt0g==)
Thu Sep 24 17:02:39 2009 - DEBUG | authorize; ['derek', 'save_system',
<cobbler.item_system.System instance at 0x727ec20>, None, True]
Thu Sep 24 17:02:39 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Sep 24 17:02:39 2009 - INFO | add_item(system);
['rhel4-64.umiacs.umd.edu']
Thu Sep 24 17:02:39 2009 - INFO | get_items; ['system']
And the system is created however the eth0 interface is not, any
ideas? Additionally when I check dumpvars on the system it gives this
error,
# cobbler system dumpvars --name=rhel4-64.umiacs.umd.edu
### ERROR ###
Unexpected remote error, check the server side logs for further info
exceptions.AttributeError:'NoneType' object has no attribute
'get_parent'
and logs this,
Thu Sep 24 17:05:26 2009 - INFO | Exception occured:
exceptions.AttributeError
Thu Sep 24 17:05:26 2009 - INFO | Exception value: 'NoneType' object
has no attribute 'get_parent'
Thu Sep 24 17:05:26 2009 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line
1725, in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line
914, in get_blended_data
return self.xmlrpc_hacks(utils.blender(self.api, True, obj))
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line
504, in blender
tree = grab_tree(api_handle, root_obj)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line
489, in grab_tree
parent = obj.get_parent()
Derek Yarnell
UNIX Systems Administrator
University of Maryland
Institute for Advanced Computer Studies
14 years, 8 months
cobbler 2.0 on Fedora 11 i386 problems
by Lester M.
Hello Everyone,
Having some trouble with dhcpd and cobbler 2.0
# cobbler check
The following are potential configuration items that you
may want to fix:
1 : dhcpd is not installed and/or in path
Of course I have dhcp installed (dhcp-4.1.0p1-2.fc11.i586)
(Now in 1.6.8 (and prior) I noticed that you could pass in configuration the
location of dhcp / dnsmasq binaries and configuration. It would be very nice
if this flexibility was brought back to cobbler. More of a want versus a
need though.. :-P Nevertheless I digress,...)
Check out how this block of code on a Fedora 11 machine runs for checking
for the presence of dhcpd
[ This is from *action_check.py* ]
def check_dhcpd_bin(self,status):
"""
Check if dhcpd is installed
"""
rc = utils.subprocess_get(self.logger,"dhcpd --help")
if rc.find("exiting") == -1:
status.append("dhcpd is not installed and/or in path")
Something in that routine test is triggering a "false" /negative/ for what
should prove "true". ("exiting." appears on the last line which is what the
code is checking for, when you type dhcpd --help from the command line.)
Confusing?
[root@localhost cobbler]# grep dhcp utils.py
def dhcpconf_location(api):
return "/etc/dhcp.conf"
return "/etc/dhcp.conf"
return "/etc/dhcp/dhcp.conf"
Also shouldn't the above return "/PATH/dhcp.conf" statements point to /PATH/
*dhcpd*.conf ? When did this change?
I validated this on RHEL5.x, Fedora10 / 11 and RHEL4.x. Is "dhcp.conf"
something special cobbler needs now? Please advise.
I do the majority of my testing / builds on Fedora 11 now, as well as
RHEL5.x at work. Would love to play around with cobbler 2.0 once dhcp is
validated!
14 years, 8 months
cobbler image file issues
by Thomas S Hatch
I figure I am missing soumthing obvious, but here goes.
When I define a cobbler image the protocol gets hacked off! So I run this
command:
cobbler image edit --file='nfs://192.168.41.76:/cobbler/ks_mirror/WinLite.iso'
--name='windows_test_1'
then I run a report:
image : windows_test_1
arch : i386
breed : windows
comment :
created : Thu Aug 13 13:30:29 2009
file : 192.168.41.76:/cobbler/ks_mirror/WinLite.iso
image type : iso
kickstart : /var/lib/cobbler/kickstarts/base.ks
modified : Thu Aug 13 13:59:46 2009
os version :
owners : ['admin']
virt bridge : br0
virt cpus : 1
network count : 1
virt file size : 15
virt path : /vm/images/
virt ram : 512
virt type : qemu
and the nfs:// is missing from the file field. So I try to install anyway:
koan --server=192.168.41.76 --virt --image='windows_test_1'
and I get this:
- looking for Cobbler at http://192.168.41.76/cobbler_api
- reading URL: http://192.168.41.76/cblr/svc/op/ks/profile/windows_test_1
warning: kickstart found but no install_tree found
libvirtd (pid 2182) is running...
- using qemu hypervisor, type=kvm
Thu, 13 Aug 2009 14:01:11 DEBUG No conn passed to Guest, opening URI
'qemu:///system'
<type 'exceptions.ValueError'>
Install media location must be an NFS, HTTP or FTP network install source,
or an existing file/device
File "/usr/lib/python2.6/site-packages/koan/app.py", line 204, in main
k.run()
File "/usr/lib/python2.6/site-packages/koan/app.py", line 312, in run
self.virt()
File "/usr/lib/python2.6/site-packages/koan/app.py", line 601, in virt
return self.net_install(after_download)
File "/usr/lib/python2.6/site-packages/koan/app.py", line 520, in
net_install
after_download(self, profile_data)
File "/usr/lib/python2.6/site-packages/koan/app.py", line 599, in
after_download
self.virt_net_install(profile_data)
File "/usr/lib/python2.6/site-packages/koan/app.py", line 1080, in
virt_net_install
virt_type = self.virt_type
File "/usr/lib/python2.6/site-packages/koan/qcreate.py", line 91, in
start_install
guest.cdrom = input_path
File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 380, in
set_cdrom
self._installer.location = val
File "/usr/lib/python2.6/site-packages/virtinst/DistroInstaller.py", line
138, in set_location
raise ValueError(_("Install media location must be an NFS, HTTP "
What might I be missing?
-Tom Hatch
14 years, 8 months
cobbler 2.0 reposync issues.
by Jeremy Rosengren
I was able to solve my earlier cobbler 2.0 issues - prior to upgrading, I
had symbolically linked /var/www/cobbler to another partition after moving
the new /var/www/cobbler to that partition and then copying my ks_mirrors
and repo_mirrors directories over, things seem to be working on the web
side.
I'm seeing a new issue when trying to do a "cobbler reposync". The reposync
process seems to be working, but at the end of the mirroring it fails with
the following error. Any suggestions for how I fix this on EL5, where
createrepo > 0.9.7 doesn't exist?
Thanks,
-- jeremy
running: /usr/bin/rpmquery --queryformat=%{VERSION} createrepo
recieved: 0.4.11
Exception occured: cobbler.cexceptions.CX
Exception value: 'this repo has presto metadata; you must upgrade createrepo
to >= 0.9.7 first and then need to resync the repo through cobbler.'
Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 108, in die
raise CX(msg)
Exception occured: cobbler.cexceptions.CX
Exception value: 'this repo has presto metadata; you must upgrade createrepo
to >= 0.9.7 first and then need to resync the repo through cobbler.'
Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line
120, in run
self.sync(repo)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line
151, in sync
return self.yum_sync(repo)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line
415, in yum_sync
os.path.walk(dest_path, self.createrepo_walker, repo)
File "/usr/lib/python2.4/posixpath.py", line 290, in walk
func(arg, top, names)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line
186, in createrepo_walker
utils.die(self.logger,"this repo has presto metadata; you must upgrade
createrepo to >= 0.9.7 first and then need to resync the repo through
cobbler.")
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 116, in
die
raise CX(msg)
reposync failed, tries left: 0
Exception occured: cobbler.cexceptions.CX
Exception value: 'reposync failed, retry limit reached, aborting'
Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 108, in die
raise CX(msg)
Exception occured: cobbler.cexceptions.CX
Exception value: 'reposync failed, retry limit reached, aborting'
Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 92, in run
rc = self._run(self)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 232, in
runner
self.remote.api.reposync(tries=self.options.get("tries",3), name=None,
nofail=False, logger=self.logger)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 625, in
reposync
return reposync.run(name)
File "/usr/lib/python2.4/site-packages/cobbler/action_reposync.py", line
129, in run
utils.die(self.logger,"reposync failed, retry limit reached, aborting")
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 116, in
die
raise CX(msg)
!!! TASK FAILED !!!
14 years, 8 months