For When You Can't Have The Real Thing
[ start | index | login ]
start > RedHat > kickstart > Cobbler > cobbler_byname


Created by dave. Last edited by dave, 17 years and 49 days ago. Viewed 7,400 times. #6
[diff] [history] [edit] [rdf]


This script is a convenience wrapper around Cobbler. At a couple of my customers, I have a large (>50) number of computers to deal with, and it is tedious to look up the IP address and MAC address for each computer I need to apply a cobbler profile to.

Fortunately I have a well-maintained NIS environment where all my system names, aliases, and MAC addresses are pre-loaded, so the attached script does the work for me.

So instead of having to say:

[root@router /]$ ypmatch tpx18 hosts    tpx18
[root@router /]$ ypcat ethers | grep tpx18
00:04:23:a6:a0:86 tpx18            #
[root@router /]$ cobbler system add --name="00:04:23:a6:a0:86" --profile="RHEL-4ES-U2-i386-ws" --pxe-address=""
[root@router /]$

...I can say instead:

[root@router /]$ cobbler_byname --host tpx18 --profile RHEL-4ES-U2-i386-ws
[root@router /]$

...which (in order to beat a dead horse some more) is a lot more scriptable:

[root@router /]$ for i in 1 25 29 55 79 ; do cobbler_byname --host tpx$i --profile RHEL-4ES-U2-i386-ws; done
[root@router /]$
Note that you still have to say cobbler sync after running my script in order to flush the changes.
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt