Code Monkey home page Code Monkey logo

cobbler's Introduction

Cobbler

Publish Python distributions to TestPyPI PyPI version PyPI - Downloads Documentation Status Matrix Codacy Badge Codacy Badge Asciinema

Cobbler is a Linux installation server that allows for rapid setup of network installation environments. It glues together and automates many associated Linux tasks so you do not have to hop between lots of various commands and applications when rolling out new systems, and, in some cases, changing existing ones. It can help with installation, DNS, DHCP, package updates, power management, configuration management orchestration, and much more.

asciicast

Read more at https://cobbler.github.io

To view the man-pages, install the RPM and run man cobbler or run perldoc cobbler.pod from a source checkout.

To build the RPM, run make rpms. Developers, try make webtest to do a local make install that preserves your configuration.

If you want to contribute you may find more information under CONTRIBUTING.md.

The documentation can be found at Readthedocs

cobbler's People

Contributors

brejoc avatar btravouillon avatar ciupicri avatar dgoodwin avatar gregswift avatar hbokh avatar heroin-moose avatar imeyer avatar javier-angulo avatar javiplx avatar jbartus avatar jeckersb avatar jimi-c avatar jlaska avatar jmaas avatar kwizart avatar mark987 avatar meaksh avatar mpdehaan avatar mvpel avatar nodeg avatar opoplawski avatar p3ck avatar pvreman avatar rbberger avatar schoolguy avatar thiller2018 avatar tiltingpenguin avatar tpw56j avatar watologo1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobbler's Issues

Broken symlinks on distro rename from web_gui

Running cobbler-2.2.1-1.el6.noarch from epel-testing on Centos 6.2
Also verified on cobbler-2.2.1-1.el5.noarch from epel-testing on RHEL 5.8

WIth the below symlinks:
[root@el6-seanscott01 links]# ls -lAh /var/www/cobbler/links
lrwxrwxrwx 1 root root 34 Feb 22 21:37 rhel5-x86_64 -> /var/www/cobbler/ks_mirror/rhel5-x86_64
lrwxrwxrwx 1 root root 34 Feb 22 21:37 rhel5-xen-x86_64 -> /var/www/cobbler/ks_mirror/rhel5-x86_64

Performing a distro rename from the web_gui results in removed symlinks but new symlinks are not created

Upgrade from 2.0.10 to 2.3.X latest version questions

We are attempting to upgrade our cobbler from 2.0.10 to 2.3.X latest version on a Centos5.5 host. Are there any gotchas or specific changes that we should watch out for?

We have made 1 attempt and it has failed?

We needed to add mod_wsgi and uncomment it in wsgi.conf to load the module. The upgrade by running make install of the git repo didnt preserve any of our prior configurations and after altering the configurations to match the original we are unable to login. We have a Apache kerberos based web authentication module but even when we convert to the basic config file based authentication it fails. Are there any wiki entries on upgrades or any advice on attempting the upgrade?

Thanks,
Reil

manage_dhcp: two related but different things?

My understanding of "mange_dhcp" is that it does two related, but different, things:

  1. Mange the DHCP files (and tftpboot files etc.)
  2. Ensure the DHCP server is running.

I think there is a case for separating these. If a site runs with static IP addresses, it is useful to have the configuration periodically cloned. For instance we have a daily cron job "cobbler replicate ..." which replicates everything including the systems onto two slaves. This allows a deployment to pick up from any DHCP server, because they are all identical and the client systems are all static-IP. The real reason for running more than one is for resilience, so really an "exactly one active DHCP instance, with automatic failover" would be sufficient. (Such failover, automatic or otherwise, is beyond the scope of Cobbler.)

But having multiple DHCP servers simultaneously active can introduce problems, especially on dynamic-IP clients. And even in our case of static-IP, the existence of slave servers can interfere with developments on the master.

So I would like to suggest for consideration that there be two controls:

  1. "manage_dhcp" to manage the files, as now, but not the DHCP server
  2. "manage_dhcp_server" would ensure the server is running.

Of course, these are asymmetrical and not independent. "2" without "1" has no meaning. So it might be better to view them in a different way:

  1. "manage_dhcp" to manage the files, as now; also manage DHCP server /unless/ "manage_dhcp_server" disables it
  2. "manage_dhcp_server": if set to 0 Cobbler will /not/ mange the DHCP process.

Part of a failover procedure would be to toggle the "manage_dhcp_server" flag.

Or something like that. Or might there be yet a better way to handle all this?

can't save networking options of a system in cobbler web interface.

After modifying and saving the networking options of a system in cobbler web interface, i found that the modification was lost.

I am using the cobbler-2.3.1-1 and cobbler-web-2.3.1-1 , which are built from the git master (the latest commit is 525122d ), on centos 6.0 . But in cobbler-2.2.2-1, it works fine.

How to reproduce

  1. add a new interface
  2. click the "Generate Random MAC" button
  3. fill the IP Address
  4. check the "static" option
  5. fill the Subnet Mask and Virt Bridge
  6. finanlly save

man page: bash problem

In the man page, the section "DISTRIBUTIONS" contains the example:

--kopts="foo=bar baz=3 asdf !gulp"

Under the bash shell this is poor; the double quotes permit bash to try to process the "!" character. This would be better written with single quotes, which I think is safe, i.e. not shell-interpreted, across all shells:

--kopts='foo=bar baz=3 asdf !gulp'

PPC64 support

Is there support to create and distribute repositories for PPC64 rpm support yet? If so how?

Tab Repos reposync fails

System Info:
Cobbler version 2.2.1-1 el5
Cobbler-web version 2.2.1-1.el5
Apache 2.2.3
CentOS 5.4
Selinux and Iptables disabled for that test.
Connecting to Cobbler via ipv6

When I try to execute a reposync on the web interface under the repos tag it fails. Executing the command on the cli works.

Here are the steps and error logs:

My Steps are:

1: Click on repos tab under configuration
2: Check repo I want to sync
3: Select reposync from the dropdown menu
4: Click on Go

results in:

Error:

An error has occurred. You may find more information in /var/log/cobbler/cobbler.log on the server shoud this error not be self explanatory.
Unknown batch operation on repos:reposync

tail -f /var/log/cobbler/cobbler.log
[root@cobbler0 cobbler]# tail -f /var/log/cobbler/cobbler.log
Sun Mar 11 16:53:22 2012 - DEBUG | done with get_items; ['profile']
Sun Mar 11 16:53:22 2012 - INFO | REMOTE version; user(cobbler)
Sun Mar 11 16:55:39 2012 - INFO | REMOTE find_items_paged(repo); criteria({}); sort(name); user(?)
Sun Mar 11 16:55:39 2012 - INFO | find_items; ['repo']
Sun Mar 11 16:55:39 2012 - INFO | REMOTE version; user(cobbler)
Sun Mar 11 16:55:48 2012 - INFO | REMOTE version; user(cobbler)
Sun Mar 11 16:56:08 2012 - INFO | REMOTE find_items_paged(repo); criteria({}); sort(name); user(?)
Sun Mar 11 16:56:08 2012 - INFO | find_items; ['repo']
Sun Mar 11 16:56:08 2012 - INFO | REMOTE version; user(cobbler)
Sun Mar 11 16:57:01 2012 - INFO | REMOTE version; user(cobbler)

tail -f /var/log/httpd/error_log
Mar 11 14:44:52 2012] [info] mod_wsgi (pid=12541): Create interpreter '127.0.0.1:9999|/cobbler_web'.
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] mod_wsgi (pid=12537): Exception occurred processing WSGI script '/var/www/cobbler/svc/services.py'., referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go

[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] Traceback (most recent call last):, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/var/www/cobbler/svc/services.py", line 79, in application, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] content = func( **form ), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib/python2.4/site-packages/cobbler/services.py", line 88, in events, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] data = self.remote.get_events(user), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in call, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] return self.__send(self.__name, args), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/xmlrpclib.py", line 1383, in __request, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] verbose=self.__verbose, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/xmlrpclib.py", line 1129, in request, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] self.send_content(h, request_body), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/xmlrpclib.py", line 1243, in send_content, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] connection.endheaders(), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] self._send_output(), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] self.send(msg), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/httplib.py", line 652, in send, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] self.connect(), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] File "/usr/lib64/python2.4/httplib.py", line 636, in connect, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] raise socket.error, msg, referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go
[Sun Mar 11 11:41:12 2012] [error] [client x:x:x::x] error: (111, 'Connection refused'), referer: http://localhost:9999/cobbler_web/repo/multi/reposync/go

man page references isc_and_bind

cobbler man page.

In DHCP MANAGEMENT:

Choose either "management = isc_and_bind" in /etc/cobbler/dhcp.template or "management = "dnsmasq" in /etc/cobbler/modules.conf. Then set "manage_dhcp" to 1 in /etc/cobbler/settings.

Should be:

Choose either "management = isc" or "management = "dnsmasq" in /etc/cobbler/modules.conf. Then set "manage_dhcp" to 1 in /etc/cobbler/settings.

In DNS CONFIGURATION MANAGEMENT:

Choose either "management = isc_and_bind" or "management = dnsmasq" in /etc/cobbler/modules.conf and then enable manage_dns in /etc/cobbler/settings.

Should be:

Choose either "management = bind" or "management = dnsmasq" in /etc/cobbler/modules.conf and then enable manage_dns in /etc/cobbler/settings.

No semicolon allowd in "--power-pass="

Hello everybody,

it looks like I cannot have an IPMI password containing a semicolon and use it with --power-pass option, no matter if i use quote or if I escape it.

I've got a "Invalid characters found in input" message.

It seems thats the utils.safe_filter function needs some love =)

koan --virt-image-type ?

I'd LOVE to be able to use qcow2 from the get go as the image format, a we need its snapshots etc. I can hack something to do a koan, watch for it to finish, convert the vm image file, then boot it, but thats ugly. Wouldn't a switch like this simply pass the format onto qemu-kvm?

RFE: Expose rsync options during replication

We have quite a few hosts replicating from a single master (across the WAN), what we've noticed is that when we add new distributions we can end up with massive quantities of data going across the links.

It would be really good if we could utilise a couple of the rsync options to prevent the links from getting hammered quite so badly. Additionally for repos that get synced it would be nice if RPMs deleted in the master went away on the slaves.

The specific rsync options we'd like to be able to use are:
--delete / --delete-after
--fuzzy
--copy-dest
--link-dest
--bwlimit

authn_pam module has SELinux issues

I'm running b9879af under Fedora 15 and the cobblerd service does not start because of SELinux denials. If I disable the authn_pam module by renaming it to something else, e.g. .PY, the cobblerd service is able to start.

I'm using selinux-policy-3.9.16-44.fc15.noarch.rpm and selinux-policy-targeted-3.9.16-44.fc15.noarch.rpm.

--breed, no such option?

Greetings all,

I'm running Cobbler 2.0.7, and I'm getting "no such option" when appending --breed=suse when trying to add a profile for a SuSE distro. I'm wondering if --breed has been deprecated and I should use another switch instead? From the docs I'm reading the --breed switch at one time dictated how Cobbler parsed kernel parameters, and it would seem as though some equivalent of this switch must be necessary to signal to the install to use the SuSe autoyast instead of the install. Any insights would be greatly appreciated. Thanks for your time!

RFE: Add a mechanism to allow hosts with an entry to boot to the menu

We manage our DHCP configs through cobbler, however at the minute when we allocate a host a static IP through cobbler they then lose the ability to select one of the options from the boot menu that you get if the host doesn't have an entry in cobbler.

It would be really nice to have a flag that drops the host back to the "default" menu rather than a specific profile.

Broken symlinks on cobbler import from cmdline

Running cobbler-2.2.1-1.el6.noarch from epel-testing on Centos 6.2
Also verified on cobbler-2.2.1-1.el5.noarch from epel-testing on RHEL 5.8

Performing an import below from the command line:
[root@el6-seanscott01 links]# cobbler import --path=/media/RHEL_5.8\ x86_64\ DVD/ --name=rhel5.8 --arch=x86_64

Creates the followingks_mirror directory:
[root@el6-seanscott01 links]# ls -lAh /var/www/cobbler/ks_mirror/
dr-xr-xr-x 8 apache apache 4.0K Feb 2 12:02 rhel5.8-x86_64

But produces broken symlinks:
[root@el6-seanscott01 links]# ls -lAh /var/www/cobbler/links
lrwxrwxrwx 1 root root 34 Feb 22 21:37 rhel5.8-x86_64 -> /var/www/cobbler/ks_mirror/rhel5.8
lrwxrwxrwx 1 root root 34 Feb 22 21:37 rhel5.8-xen-x86_64 -> /var/www/cobbler/ks_mirror/rhel5.8

buildiso --standalone should include repo contents

See https://fedorahosted.org/pipermail/cobbler/2012-January/007166.html. It would be great if the "buildiso --standalone" command could be made to also include any locally mirrored repo contents. The reason is that I want to be able to create a shippable DVD (or publicly downloadable ISO file) that will be used outside of our network, where there is no access to the Cobbler server whatsoever.

Currently, the ISO will include the original install tree, but not the additional repo's that I've included in the profile(s).

Why does cobbler/svc/services.py call os.path.realpath(my_uri)?

While looking at webserver cpu usage, I noticed this in cobbler/svc/services.py:application():

   # canonicalizes uri, mod_python does this, mod_wsgi does not
   my_uri = os.path.realpath(my_uri)

This doesn't make sense to my as my_uri will be like "/cblr/svc/op/events/user/orion" which isn't a real path on the filesystem. Are there cases I'm missing? I commented it out to no harm so far. No noticeable cpu usage benefit either though.

reposync using rsync makes more work for createrepo

When using rsync for the repository definitions, createrepo is having to work a lot harder than it should have to. Each reposync, rsync ends up deleting the createrepo cache directory for each repo, and replacing the repodata directory with the one from the source server. This means that createrepo has to recreate all of the metadata, without benefiting from "-c cache" or "--update".

cobbler/pxegen.py:make_actual_pxe_menu broken if there are images

to reproduce this, just go to your web UI and add an image. You can give it '/etc/passwd' for file (it doens't really matter), and then try to 'cobbler sync'.

make_actual_pxe_menu does:

       # image names towards the bottom
        for image in image_list:
            if os.path.exists(image.file):
                contents = self.write_pxe_file(filename=None, system=None,
                        profile=None, distro=None, arch=image.arch, image=image)
                if contents is not None:
                    pxe_menu_items = pxe_menu_items + contents + "\n"

The key point there is 'write_pxe_file' is called with 'distro=None'.

write_pxe_file will then stack trace on

  if distro.os_version.startswith("esxi") and filename is not None

This was originally seen in ubuntu at http://pad.lv/943000 .

This is obviously related to issue 16 (#16).
The simple immediate crutch is to do:

if distro and distro.os_version.startswith("esxi") and filename is not None

strange problem

try to access kickstart file http://192.168.1.3/cblr/svc/op/ks/profile/CentOS5.4-x86_64, give up with a error message:
"
Mod_python error: "PythonHandler services"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)

File "/var/www/cobbler/svc/services.py", line 89, in handler
content = func( **form )

File "/usr/lib/python2.4/site-packages/cobbler/services.py", line 91, in ks
data = self.remote.generate_kickstart(profile,system,REMOTE_ADDR,REMOTE_MAC)

File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in call
return self.__send(self.__name, args)

File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose

File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)

File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
return u.close()

File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
raise Fault(**self._stack[0])

Fault: <<="" eof="">> /etc/sysctl.conf\n97 |net.ipv4.ip_forward = 0\n98 |net.ipv4.conf.default.rp_filter = 1\n'>

"

Make cobbler import be more squeaky when it doesn't import anything

Seems to be a frequent mailing list topic -- someone trying to import something incorrectly.

If no distros get added by an import, raise an error and suggest what got copied over in ks_mirror should be deleted, and that users should look towards distro add if it's Linux, or otherwise read the Wiki about what's supported.

Web Interface: Profile Edit

Cobbler web interface page for editing a profile contains a lost of repos.
That list needs to be made wider and/or have a width adustment control available to handle repo names longer than about 10 or 12 characters.
I have a screenshot. How do I upload it ?

replicate fails to create profile

When I try to replicate systems from one cobbler host to another it fails to replicate the profile across.

I'm trying to use one cobbler host as the management host and a couple other hosts running cobbler replicating for dns only.

Both hosts are running cobbler-2.0.11-2.el6.noarch

cobbler replicate --master 10.85.15.147 --systems=* --omit-data
task started: 2012-01-23_110645_replicate
task started (id=Replicate, time=Mon Jan 23 11:06:45 2012)
cobbler_master   = 10.85.15.147
profile_patterns = []
system_patterns  = ['*']
omit_data        = True
sync_all         = False
using CLI defined master
XMLRPC endpoint: http://10.85.15.147/cobbler_api
test ALPHA
test BETA
Querying Both Servers
remote names struct is {'profile': ['centos6'], 'repo': ['epel', 'core', 'base'], 'image': [], 'system': ['dns02', 'mgmt01', 'dns01'], 'distro': ['centos6']}
* Finding Explicit distro Matches
* Finding Explicit profile Matches
* Finding Explicit system Matches
?: seeing if powepgdns02 looks like *
?: seeing if powepgmgmt01 looks like *
?: seeing if powepgdns01 looks like *
* Finding Explicit repo Matches
* Finding Explicit image Matches
* Adding Profiles Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
* Adding Profiles Required By SubProfiles
* Adding Distros Required By Profiles
Adding repo centos6 for profile centos6.
* Adding Repos Required By Profiles
* Adding Images Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
transfer list for distro is ['centos6']
transfer list for profile is ['centos6']
transfer list for system is ['dns02', 'mgmt01', 'dns01']
transfer list for repo is ['epel', 'core', 'base']
transfer list for image is []
*NOT* Removing Objects Not Stored On Master
*NOT* Rsyncing Data
Adding Objects Not Stored On Local
adding distro centos6
adding profile centos6
Updating Objects Newer On Remote
Syncing
Exception occured: <class 'cobbler.cexceptions.CX'>
Exception value: 'system powepgdns02 references a missing profile centos6'
Exception Info:
  File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 95, in run
    rc = self._run(self)
   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 210, in runner
    self.logger
   File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 782, in replicate
    sync_all         = sync_all
   File "/usr/lib/python2.6/site-packages/cobbler/action_replicate.py", line 344, in run
    self.api.sync()
   File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 611, in sync
    return sync.run()
   File "/usr/lib/python2.6/site-packages/cobbler/action_sync.py", line 123, in run
    self.pxegen.write_all_system_files(x)
   File "/usr/lib/python2.6/site-packages/cobbler/pxegen.py", line 226, in write_all_system_files
    raise CX("system %(system)s references a missing profile %(profile)s" % { "system" : system.name, "profile" : system.profile})

!!! TASK FAILED !!!

Running cobbler list reveals everything has replicated except distros and profiles:

cobbler list
distros:

profiles:

systems:
   powepgdns01
   powepgdns02
   powepgmgmt01

repos:
   base
   core
   epel

So I manually create the distro and profile:

wget http://mirror.bytemark.co.uk/centos/6.1/os/x86_64/isolinux/initrd.img -O /var/lib/cobbler/loaders/centos6_initrd.img
wget http://mirror.bytemark.co.uk/centos/6.1/os/x86_64/isolinux/vmlinuz -O /var/lib/cobbler/loaders/centos6_vmlinuz
cobbler distro add --name centos6 --initrd /var/lib/cobbler/loaders/centos6_initrd.img --kernel /var/lib/cobbler/loaders/centos6_vmlinuz
cobbler profile add --distro centos6 --name centos6 --name-servers "10.85.xx 10.85.xx 10.85.xx" --name-servers-search "other.subdomain.domain.com sub.domain.com domain.com" --repos "base core epel" --kickstart /var/lib/cobbler/kickstarts/default.ks

Now I can replicate once with no problems:

cobbler replicate --master 10.85.15.147 --systems=* --omit-datatask started: 2012-01-23_111622_replicate
task started (id=Replicate, time=Mon Jan 23 11:16:22 2012)
cobbler_master   = 10.85.15.147
profile_patterns = []
system_patterns  = ['*']
omit_data        = True
sync_all         = False
using CLI defined master
XMLRPC endpoint: http://10.85.15.147/cobbler_api
test ALPHA
test BETA
Querying Both Servers
remote names struct is {'profile': ['centos6'], 'repo': ['epel', 'core', 'base'], 'image': [], 'system': ['powepgdns02', 'powepgmgmt01', 'powepgdns01'], 'distro': ['centos6']}
* Finding Explicit distro Matches
* Finding Explicit profile Matches
* Finding Explicit system Matches
?: seeing if powepgdns02 looks like *
?: seeing if powepgmgmt01 looks like *
?: seeing if powepgdns01 looks like *
* Finding Explicit repo Matches
* Finding Explicit image Matches
* Adding Profiles Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
* Adding Profiles Required By SubProfiles
* Adding Distros Required By Profiles
Adding repo centos6 for profile centos6.
* Adding Repos Required By Profiles
* Adding Images Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
transfer list for distro is ['centos6']
transfer list for profile is ['centos6']
transfer list for system is ['powepgdns02', 'powepgmgmt01', 'powepgdns01']
transfer list for repo is ['epel', 'core', 'base']
transfer list for image is []
*NOT* Removing Objects Not Stored On Master
*NOT* Rsyncing Data
Adding Objects Not Stored On Local
adding distro centos6
adding profile centos6
Updating Objects Newer On Remote
Linking Distro centos6
Syncing
Done
*** TASK COMPLETE ***

If I try to replicate again:

cobbler replicate --master 10.85.15.147 --systems=* --omit-data
task started: 2012-01-23_111644_replicate
task started (id=Replicate, time=Mon Jan 23 11:16:44 2012)
cobbler_master   = 10.85.15.147
profile_patterns = []
system_patterns  = ['*']
omit_data        = True
sync_all         = False
using CLI defined master
XMLRPC endpoint: http://10.85.15.147/cobbler_api
test ALPHA
test BETA
Querying Both Servers
remote names struct is {'profile': ['centos6'], 'repo': ['epel', 'core', 'base'], 'image': [], 'system': ['powepgdns02', 'powepgmgmt01', 'powepgdns01'], 'distro': ['centos6']}
* Finding Explicit distro Matches
* Finding Explicit profile Matches
* Finding Explicit system Matches
?: seeing if powepgdns02 looks like *
?: seeing if powepgmgmt01 looks like *
?: seeing if powepgdns01 looks like *
* Finding Explicit repo Matches
* Finding Explicit image Matches
* Adding Profiles Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
* Adding Profiles Required By SubProfiles
* Adding Distros Required By Profiles
Adding repo centos6 for profile centos6.
* Adding Repos Required By Profiles
* Adding Images Required By Systems
?: requires profile: centos6
?: requires profile: centos6
?: requires profile: centos6
transfer list for distro is ['centos6']
transfer list for profile is ['centos6']
transfer list for system is ['powepgdns02', 'powepgmgmt01', 'powepgdns01']
transfer list for repo is ['epel', 'core', 'base']
transfer list for image is []
*NOT* Removing Objects Not Stored On Master
*NOT* Rsyncing Data
Adding Objects Not Stored On Local
Updating Objects Newer On Remote
Linking Distro centos6
Exception occured: <type 'exceptions.NameError'>
Exception value: global name 'base' is not defined
Exception Info:
  File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 95, in run
    rc = self._run(self)
   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 210, in runner
    self.logger
   File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 782, in replicate
    sync_all         = sync_all
   File "/usr/lib/python2.6/site-packages/cobbler/action_replicate.py", line 342, in run
    self.link_distros()
   File "/usr/lib/python2.6/site-packages/cobbler/action_replicate.py", line 193, in link_distros
    print _("- symlink creation failed: %(base)s, %(dest)s") % { "base" : base, "dest" : dest_link }

!!! TASK FAILED !!!

python MemoryError in authn_pam.py

Reproduced on CentOS 6.2 (pytrhon 2.6.6) and Fedora16 (python 2.7.2)

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.6/site-packages/cobbler/api.py", line 127, in init
module_loader.load_modules()
File "/usr/lib/python2.6/site-packages/cobbler/module_loader.py", line 62, in load_modules
blip = import("modules.%s" % ( modname), globals(), locals(), [modname])
File "/usr/lib/python2.6/site-packages/cobbler/modules/authn_pam.py", line 53, in
from ctypes import CDLL, POINTER, Structure, CFUNCTYPE, cast, pointer, sizeof
File "/usr/lib64/python2.6/ctypes/init.py", line 546, in
CFUNCTYPE(c_int)(lambda: None)
MemoryError

get_latest_task_info() consumes a lot of server cpu

get_latest_task_info() ends up consuming a fair amount of cpu on my (admittedly old) server. I'm wondering if there is any way to reduce this load? One thing I noticed with strace is that it calls recv() a lot with 1 byte buffers:

connect(49, {sa_family=AF_INET, sin_port=htons(25151), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
send(49, "POST /RPC2 HTTP/1.0\r\nHost: 127.0"..., 147, 0) = 147
send(49, "\n<methodCal"..., 159, 0) = 159
recv(49, "H", 1, 0) = 1
recv(49, "T", 1, 0) = 1
recv(49, "T", 1, 0) = 1
recv(49, "P", 1, 0) = 1
.....

Preserve timestamps when copying files

It would be helpful if cobbler preserved timestamps when copying files, particularly the tftpboot images so as to help with debugging. One can more easily compare with the source and find issues. I'm not sure the best way to do this. I don't think replacing copyfile with copy2 or using copystat is correct as you only want to preserve the timestamps, not the ownership or permissions.

python Time Zone Error in Cobbler_web -- /usr/share/cobbler/web/settings.py incorrect default value?

I get this same wrong time zone result on Centos6, Fedora14, Fedora15 and Fedora16 when trying to access my cobbler_web server.

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 212, in handler
    return ModPythonHandler()(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 174, in __call__
    self.load_middleware()

  File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 39, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 276, in __getattr__
    self._setup()

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 125, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)

ValueError: Incorrect timezone setting: America/NewYork

It was working in October just fine. All machines are set for America/Kentucky/Louisville TZ as far as I can tell unless it's referring to a cobbler TZ setting and not the system wide ones. I've even tried changing the setting listed in /usr/share/cobbler/web/settings.py.

My first successful work around was to copy the file /usr/share/zoneinfo/America/New_York to /usr/share/zoneinfo/America/NewYork.

Then I found the NewYork tz entry in /usr/share/cobbler/web/settings.py

Found that you can change the entry in /usr/share/cobbler/web/settings.py from NewYork to New_York and python compileall.pyo /usr/share/cobbler/web/ as a work around also.

kickstart not found error when path has leading space - cobbler_web

It turns out that if a kickstart path on system or profile page has a leading space it errors out. While I know one should not have a leading space, I don't see a valid case where a leading space is significant in the kstart path. My recommendation is that when parsing the field we strip off all leading spaces.

Cobbler drops errors on the floor during a replicate

We've an old installation which has lots of subtly broken distros profiles and systems. While trying to sync up a new slave I noticed that various bits and pieces weren't syncing across. No errors, just objects that didn't appear on the slave.

I tracked it down to collection.py which is catching an exception, returning false and not logging anything.

A simple error level log call would have made my life much simpler...

    try:
        ref.check_if_valid()
    except CX, error:
        return False

pxegen.py fails to add memtest entry

After installing the memtest86+ package and running 'cobbler sync', there was not a entry for memtest in my boot menu. I traced the problem down to the pxegen.py file where the memtest image is copied to the directory "tftpboot/images/", but it looks in the "tftpboot" directory when it tries to add it to the pxelinux0.cfg/default file.

A symbolic link from tftpboot/images/memtest* to /tftboot/memtest* make everything work.

cobbler_api port does not change when the http_port has been changed (Breaks replicate)

When I tried to use "cobbler replicate" it would connect to the cobbler master on port 80 with no issue. But then turned around and tried to connect to http://127.0.0.1/cobbler_api when in the /etc/cobbler/settings file I specified http_port to be different.

After changing a line in /usr/lib/python2.4/site-packages/cobbler/action_replicate.py from

self.local = xmlrpclib.Server("http://127.0.0.1/cobbler_api")
to
self.local = xmlrpclib.Server("http://127.0.0.1:2080/cobbler_api")

It worked with no issues.

I would like to see that portion of the code use a variable that is pulled from the /etc/cobbler/settings file.

I am running RPM version cobbler-2.2.1-1 on CentOS 5.6

Redhat rescue mode via cobbler

Imagine a Redhat box installed with cobbler. Sometime later, imagine it in trouble and needing "rescue mode" to diagnose it. It would be very useful to be able to do something like: "cobbler system edit --name=poorly --rescue-mode=true". (Or perhaps "... --netboot-enabled=rescue-mode".)

Having this available as a simple flag would be very useful; the user shouldn't be required to set up all sorts of profiles. (If the implementation requires different internal profile functionality, this ought to be transparent to the typical user.)

See email thread 'redhat "rescue mode"?', started 2011/12/06.

reposync with --tries > 1 always repeats, even on success

The cobbler man page suggests setting up a crontab with --no-fail and --tries=3. When running with this configuration, the reposync/rsync commands are always run 3 times, regardless of the sync result. I would only expect it to try again if the last attempt failed.

misleading typo in comment

The comment at the top of "rsync.template" says: "...make your changes in /etc/cobbler/rsyncd.template...". That file reference (to itself) ought to be indicate "rsync.template", not "rsyncd.template".

Also the "...generated from cobbler rsyncd.conf template" just above it should probably also be checked as it is unclear and is attempting an unnecessary repeat. In fact, I would suggest reviewing the entire comment for clarity.

buildiso fails ...

Hi all,

for our laboratory I want to create an ISO image with
cobbler buildiso --standalone --distro="centos6-x86_64"
and a standard CentOS 6.2 distribution.

It fails with
genisoimage: Error: /var/cache/cobbler/buildiso/repodata/3a27232698a261aa4022fd270797a3006aa8b8a346cbd6a31fae1466c724d098-c6-x86_64-comps.xml.gz and /var/cache/cobbler/buildiso/repodata/3a27232698a261aa4022fd270797a3006aa8b8a346cbd6a31fae1466c724d098-c6-x86_64-comps.xml have the same Joliet name

I could heal it by calling the mkisofs manually with the "-joliet-long" switch:
mkisofs -o /root/generated.iso -r -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -joliet-long -boot-info-table -V Cobbler\ Install -R -J -T /var/cache/cobbler/buildiso
and good a usable ISO file.

If it is reasonable, can that switch be added ?

Greetings
sanamdrychili

cobbler distro report dies in gzip.py - Not a gzipped file

I'm running on Fedora-14 for a while and just encountered the problem (details below).

Environment:
Fedora-14
cobbler-web-2.2.1-1.fc14.noarch
cobbler-2.2.1-1.fc14.noarch
python-2.7-8.fc14.1.x86_64

Command and traceback

cobbler distro report --name=CentOS-6.1-x86_64
Traceback (most recent call last):
File "/usr/bin/cobbler", line 35, in
sys.exit(app.main())
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 543, in main
rc = cli.run(sys.argv)
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 207, in run
self.object_command(object_type, object_action)
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 305, in object_command
report_item(self.remote,object_type,None,options.name)
File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 64, in report_item
item = remote.get_item(otype, name)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in call
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request
verbose=self.__verbose
File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1457, in parse_response
data = stream.read(1024)
File "/usr/lib64/python2.7/gzip.py", line 243, in read
self._read(readsize)
File "/usr/lib64/python2.7/gzip.py", line 278, in _read
self._read_gzip_header()
File "/usr/lib64/python2.7/gzip.py", line 174, in _read_gzip_header
raise IOError, 'Not a gzipped file'

phantom entries

Looks like some phantom entries are kicking around. I used to have a "debuglaptop" system defined but removed it with "cobbler system remove". I don't recall how I removed the SF2250 image but I think it was done with cobbler and not by hacking the filesystem somwhere.

[root@solexa-db ~]# cobbler list
distros:

profiles:

systems:

repos:

images:
SF2250
SF2250-1
[root@solexa-db ~]# cobbler image remove --name=SF2250
cobbler.cexceptions.CX:'cannot delete an object that does not exist: debuglaptop'
[root@solexa-db ~]#

Exception value: global name 'out_path' is not defined

cobbler version: Cobbler 2.3.1
run # cobbler sync command has this error
please tell me how to fix the issue,Thanks

rendering DHCP files
generating /etc/dhcpd.conf
Exception occured: exceptions.NameError
Exception value: global name 'out_path' is not defined
Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 89, in run
rc = self._run(self)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 184, in runner
return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 701, in sync
return sync.run()
File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 132, in run
self.dhcp.write_dhcp_file()
File "/usr/lib/python2.4/site-packages/cobbler/modules/manage_isc.py", line 194, in write_dhcp_file
self.templar.render(template_data, metadata, self.settings_file, None)
File "/usr/lib/python2.4/site-packages/cobbler/templar.py", line 113, in render
data_out = self.render_cheetah(raw_data, search_table, subject)
File "/usr/lib/python2.4/site-packages/cobbler/templar.py", line 209, in render_cheetah
if out_path is None:

!!! TASK FAILED !!!

ignoring options is poor

(This is low priority.)

For "adding systems", the man page says (under the "--ip" option): "When using the CIDR notation trick, don’t specify any arguments other than --name and --profile... they won’t be used."

That implies that if the user enters other arguments, their requests will be silently ignored. If so, I suggest that this is poor practice. Rather, it should at least issue warning messages for any options that it is ignoring. (One might argue that this is an error, and so issue error messages and stop; I'm not expert enough to judge whether this should be warning or error.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.