cobbler_byname
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
10.0.253.128 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="10.0.253.128"
[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.