Getting cobbler installed and configured is pretty easy. Here are the steps I typically use on a Fedora-derived system:
Install cobbler and httpd
$ yum -y install cobbler httpd fence-agents debmirror
Enable TFTP services
$ sed -i 's/^\(.*disable.*=\).*/\1 no/' /etc/xinetd.d/tftp
Start and enable services
$ systemctl enable cobblerd.service
$ systemctl start cobblerd.service
$ systemctl enable httpd
$ systemctl start httpd
$ systemctl enable tftp
$ systemctl start tftp
Edit the cobbler configuration file to suit your needs
$ vi /etc/cobbler/settings
Run cobbler to see how it feels about your settings
$ cobbler check
Synchronize content
$ cobbler sync
Import an initial image (CentOS 7 in this case)
$ mount -o loop CENTOS_DVD /mnt
$ cobbler import --name=centos7 --arch=x86_64 --path=/mnt
Check to make sure the distribution imported
$ cobbler distro list
$ cobbler distro report --name=centos7
Add a system to cobbler
You can use cobbler system add to create a new system:
$ cobbler system add --name=$FQDN --profile=$PROFILE --mac=$MACADDR \
--ip-address=$IPADDR --netmask=$NETMASK --static=1 --dns-name=$FQDN \
--gateway=$GATEWAY --interface=$INTERFACE \
--name-servers-search="prefetch.net" \
--kickstart="/var/lib/cobbler/kickstarts/${profile}.ks" \
--name-servers=$DNS_SERVERS
To verify the system is present you can use the report option:
$ cobbler system report $FQDN
If everything succeeded up to this point you should be able to PXE boot your host.
Add snippet to apply base ansible CM policy
$ cat /var/lib/cobbler/snippets/post_installation_tasks
echo "Applying the latest set of system updates to the server"
/usr/bin/dnf -y update
if [$? -ne 0]; then
exit 1
fi
echo "Installing ansible to manage our systems"
/usr/bin/dnf -y install ansible
if [$? -ne 0]; then
exit 1
fi
echo "Installing git to pull down our configuration repository"
dnf -y install git
if [$? -ne 0]; then
exit 1
fi
echo "Running ansible to lay down the base system configuration"
mkdir /ansible && cd /ansible
git clone https://myrepo/ansible
if [$? -ne 0]; then
exit 1
fi
ansible-playbook site.yml
if [$? -ne 0]; then
exit 1
fi
This document assumed a couple of items
- You are running an external ISC DHCP server and the next-server and filename DHCP options are populated. You modified the sample.ks and created a new kickstart profile in /var/lib/cobbler/kickstarts The document assumes you are familiar with the settings file which is discussed at length in the official documentation