Cobbler 2.0.1 Triggers?
by Jonas Hagberg
Hej.
My old trigger don't work any more. None of my test triggers are
executed either.
I have them in
/var/lib/cobbler/triggers/install/post
How are you supposed to write triggers these days?
I am using s shorter variant of the cfenginge ppkeys trigger found on.
https://fedorahosted.org/cobbler/wiki/CobblerTriggers
I have the cfengine on the same server as cobbler. But it dont work any
more.
I have also tried to copy and edit a trigger in the.
site-packages/cobbler/modules
i used the install_post_log.py as template
But id don't seam to run either.
Any one could tell me how to do it the right way?
cheers
--
-------------------------------------------
Systemexpert jonas.hagberg(a)it.uu.se
Jonas Hagberg tel 018 - 471 1026
UPPMAX fax: 018 - 51 19 25
Uppsala universitet
Box 337, Lägerhyddsv 2E, Hus 4, room 4111
751 05 Uppsala www.uppmax.uu.se
-------------------------------------------
14 years, 1 month
wget hangs syncing CentOS repos
by Andy Miller
Folks,
I've set up a Cobbler server to mirror CentOS 5.4. Everything seems OK,
except that when I do a reposync things hang.
Having a poke arround seems to indicate that reposync is trying to wget
comps.xml from the repos, but the CentOS repos don't have a comps.xml.
If I kill the wget, then the rest of the reposync seems to procede OK,
but this is kind of stops the reposync being an overnight task.
Any ideas how I can cure this?
Many Thanks
Andy Miller
--
The Miller Family
doneath(a)fmail.co.uk
14 years, 2 months
Getting rid of bad cobbler metavariables
by Adam Rosenwald
A FAQ that I have brought up on numerous occasions on IRC involves
'getting rid of bad cobbler metavariables'.
If I were to set a wrong ks_meta variable NAME, how do I get rid of the
NAME without taking out ks_meta entirely.
E.g.
`cobbler system add --name=NAME --ksmeta='arg0=val0 arg1=val1
*art2*=val2 ... argN=valN' ...`
There are quite a number of scenarios where I don't want to remove all
of ksmeta, but only a mistyped variable name. I have heard about the
'!ARG' syntax:
E.g.
`cobbler system edit --in-place --name=NAME --ksmeta='*!art2*'`
Supposedly this syntax will, upon deserialization of the JSON, clear the
ks_meta namespace of *art2*; however, upon issuing a report on a given
entity, the flawed variable will still appear along with the negated
variable.
I.e.
ks_meta : 'arg0=val0 arg1=val1 *art2*=*val2* ... argN=valN *!art2*'
For those who make use of this data for inventory or other purposes, the
'!VAR' notation does not cut it. I would like a definitive explanation
of how to remove bad metavariables irrespective of deserialization.
Thanks,
- A.
14 years, 3 months
Cobbler Web 2.0.2 Errors
by William Sweat
Hello all,
I just upgraded from 2.0.1 to 2.0.2 (CentOS 5.4).
I can't edit, view, or create profiles using the cobber web gui. If I try to create a new profile I get this error:
TemplateSyntaxError at /cobbler_web/profile/edit
Caught an exception while rendering: iteration over non-sequence
Original Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/template/debug.py", line 71, in render_node
result = node.render(context)
File "/usr/lib/python2.4/site-packages/django/template/defaulttags.py", line 125, in render
values = list(values)
TypeError: iteration over non-sequence
When I scroll down for more info, this same line shows in all the errors:
Caught an exception while rendering: iteration over non-sequence
385 {% for choice in item.choices %}
Is there a fix for this?
Thanks,
Will Sweat
Findology Interactive Media, Inc
________________________________
CONFIDENTIALITY NOTICE
This communication (and/or the documents accompanying it) may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received it in error, please advise the sender by reply e-mail and immediately delete the message and any attachments without copying or disclosing the contents.
14 years, 3 months
Kickstarting client without PXE?
by brown wrap
I am browsing the docs on Cobbler and everything seems to refer to kickstating a machine using pxe boot. I have machines that don't have that capability. Can I use the setup to boot off a cd and then start the installation? Thanks.
greg
14 years, 3 months
[PATCH] authn_ldap module with referrals and multiple baseDN
by Phil Gardner
This patch adds support for:
-LDAP referrals, or the disabling thereof
-Multiple baseDNs
To support this an option needs to be added to /etc/cobbler/settings:
ldap_referrals: 0 (or 1)
So for instance if you have an Active Directory environment with multiple
domains or forests, you might want:
ldap_referrals: 0
I chased this down because I kept getting the following error, even though I
knew my bindDN was correct:
OPERATIONS_ERROR: {'info': '00000000: LdapErr: DSID-0C090627, comment:
In order to perform this operation a successful bind must be completed
on the connection., data 0, vece', 'desc': 'Operations error'}
>From some googling I believe this is only really relevant for Active
Directory environments.
I also added support for multiple baseDNs, in case you have inherited an
insane LDAP hierarchy. These can be separated by semicolons:
ldap_base_dn:
'ou=London,ou=UK,dc=example,dc=com;ou=Austin,ou=US,dc=example,dc=com;'
As an aside this is the first time I've ever written anything in Python so I
apologize if the code is crap. :)
--PG
diff -u authn_ldap.py authn_ldap2.py
--- authn_ldap.py 2009-12-21 15:59:33.000000000 -0600
+++ authn_ldap2.py 2009-12-22 08:59:04.000000000 -0600
@@ -57,6 +57,7 @@
tls = api_handle.settings().ldap_tls
anon_bind = api_handle.settings().ldap_anonymous_bind
prefix = api_handle.settings().ldap_search_prefix
+ referrals = api_handle.settings().ldap_referrals
# allow multiple servers split by a space
if server.find(" "):
@@ -80,6 +81,15 @@
# connect to LDAP host
dir = ldap.initialize(uri)
+ # turn off LDAP referrals if referrals is 'off', 'false', or 'no'
+ referrals = str(referrals).lower()
+ if referrals in ["off", "false", "no", "0" ]:
+ try:
+ dir.set_option(ldap.OPT_REFERRALS, 0)
+ except:
+ traceback.print_exc()
+ return False
+
# start_tls if tls is 'on', 'true' or 'yes'
# and we're not already using old-SSL
tls = str(tls).lower()
@@ -110,27 +120,33 @@
# perform a subtree search in basedn to find the full dn of the user
# TODO: what if username is a CN? maybe it goes into the config file
as well?
filter = prefix + username
- result = dir.search_s(basedn, ldap.SCOPE_SUBTREE, filter, [])
- if result:
- for dn,entry in result:
- # username _should_ be unique so we should only have one result
- # ignore entry; we don't need it
- pass
- else:
- return False
- try:
- # attempt to bind as the user
- dir.simple_bind_s(dn,password)
- dir.unbind()
- return True
- except:
- # traceback.print_exc()
- return False
+ # allow multiple base DNs for more complex LDAP environments
+ # this splits on a semicolon
+ if basedn.find(";"):
+ basedns = basedn.split(";")
+ else:
+ basedns = [basedn]
+
+ result = None
+ for basedn in basedns:
+ result = dir.search_s(basedn, ldap.SCOPE_SUBTREE, filter, [])
+ if result:
+ for dn,entry in result:
+ # username _should_ be unique so we should only have one
result
+ # ignore entry; we don't need it
+ pass
+ try:
+ # attempt to bind as the user
+ dir.simple_bind_s(dn,password)
+ dir.unbind()
+ return True
+ except:
+ # traceback.print_exc()
+ return False
# catch-all
return False
if __name__ == "__main__":
api_handle = cobbler_api.BootAPI()
print authenticate(api_handle, "guest", "guest")
-
14 years, 4 months
cobbler / koan - dhcp leases consumed
by Terry McIntyre
I wish to provision several virtual clients on a single virtual server.
Tried the following:
cobbler system add --name=test1 --profile=centos-5.3-xen-x86_64
--virt-type=xenpv --ip=192.168.62.75 --static=yes
--subnet=255.255.254.0 --gateway=192.168.62.40 --virt-cpus=2
--virt-ram=4096
cobbler system add --name=test2 --profile=centos-5.3-xen-x86_64
--virt-type=xenpv --ip=192.168.62.76 --static=yes
--subnet=255.255.254.0 --gateway=192.168.62.40 --virt-cpus=2
--virt-ram=4096
cobbler system add --name=test3 --profile=centos-5.3-xen-x86_64
--virt-type=xenpv --ip=192.168.62.77 --static=yes
--subnet=255.255.254.0 --gateway=192.168.62.40 --virt-cpus=2
--virt-ram=4096
On the virtual server:
koan --server=admin --virt --system=test1
koan --server=admin --virt --system=test2
koan --server=admin --virt --system=test3
Discovered failures during testing -- which eventually were traced to
the exhaustion of all available DHCP client leases.
Specifying the MAC address of the physical host fails. If I pick some
other MAC address, how do I avoid picking one already in use?
Is there a way to tell koan to begin the kickstart using a specified
IP address, instead of acquiring the initial address via DHCP?
--
Terry McIntyre
UNIX for hire
Software Development, Systems Administration, Security
terry.mcintyre(a)gmail.com
14 years, 4 months
koan and python-virtinst
by Eric Doutreleau
Hi
I have just updated my server to centos 5.4 and python-virtinst 0.400
and it seems that this version is not compatible anymore with koan 1.6.8
indeed in line 72 of the file
guest = virtinst.FullVirtGuest(installer=DistroManager.PXEInstaller())
but the file DistroManager.py has dissapeared from python-virtinst-0.300
to python-virtinst-0.400.
Is there an updated version of koan somewhere compatible with
python-virtinst-0.400?
14 years, 4 months
invalid format for IP address
by Ashley Wright
Hi,
I have been setting up cobbler over the last couple of days. All has
been going well, can network boot using profiles. Was trying to add a
system with a fixed IP address (would like DHCP to configure this for
me). So tried the following and got these errors when I try to add an ip
address:
#cobbler system add --name=leo-d --mac=00:10:18:41:49:38
--profile=optiportal
#cobbler system edit --name=leo-d --interface=eth1 --ip=192.168.1.4
invalid format for IP address (192.168.1.4)
I am not sure what is wrong with the format of my IP address?
/var/log/cobbler/cobbler.log
# tail -n20 /var/log/cobbler/cobbler.log
Thu Dec 17 16:33:18 2009 - INFO | get_item; ['system', 'leo-d']
Thu Dec 17 16:33:18 2009 - DEBUG | authorize; ['<DIRECT>',
'modify_system', <cobbler.item_system.System instance at
0x7fc460088050>, 'modify_interface', True]
Thu Dec 17 16:33:18 2009 - INFO | REMOTE authorization result: True;
user(?)
Thu Dec 17 16:33:18 2009 - INFO | find_items; ['system']
Thu Dec 17 16:33:18 2009 - INFO | Exception occured: <class
'cobbler.cexceptions.CX'>
Thu Dec 17 16:33:18 2009 - INFO | Exception value: 'invalid format for
IP address (192.168.1.4)'
Thu Dec 17 16:33:18 2009 - INFO | Exception Info:
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 1725,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 829,
in xapi_object_edit
self.modify_system(handle, 'modify_interface', imods, token)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 755,
in modify_system
return self.modify_item("system",object_id,attribute,arg,token)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 748,
in modify_item
return method(arg)
File "/usr/lib/python2.6/site-packages/cobbler/item_system.py", line
511, in modify_interface
if field == "ipaddress" : self.set_ip_address(value, interface)
File "/usr/lib/python2.6/site-packages/cobbler/item_system.py", line
295, in set_ip_address
raise CX(_("invalid format for IP address (%s)") % address)
Any help would be appreciated?
Thanks,
Ashley
--
Ashley Wright
HPC and Research Support Group
Queensland University of Technology (QUT)
14 years, 4 months