Skip to content

cobbler_system_add.sh

by on November 19, 2013
#!/bin/bash
#
# ip - he suffix of the IP - 10.232.83.$ip
# profile = rhel63-x86_64 or CentOS6-x86_64
# mac - mac from the server / vm if [ $# -ne 3 ]
then
echo "Usage: $0 <ip> <profile> <mac>"
echo "where -"
echo " ip is the suffix of the ip address - 10.232.83.XXX"
echo " profile in rhel63-x86_64 or CentOS6-x86_64"
echo " mac - mac from the server / vm"
exit 1
fi
ip=$1
profile=$2
mac=$3
cobbler system add \
--name=h${ip} \
--profile=${profile} \
--mac=${mac} \
--ip-address=10.232.83.${ip} \
--netmask=255.255.255.0 \
--hostname=h${ip}.example.com \
--netboot-enabled=Y \
--comment="h${ip} ${profile}" \
--gateway=10.232.83.1 \
--static=1 \
--name-servers=10.232.83.21 \
--dns-name=h${ip}.example.com \
--interface=eth0

cobbler sync
cobbler system report --name=h$ip
Advertisements

From → Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: