My Cobbler documentation¶
Personal notes on the tool Cobbler.
Cobbler Installation on Centos/Redhat 7¶
Cobbler version: | |
---|---|
2.6.0 | |
Linux version: | Centos/Redhat 7.0 |
Note
Official installation doc: http://cobbler.github.io/manuals/2.6.0/2/2/2_-_RHEL_and_CentOS.html
Steps¶
Set SELinux to “permissive” mode (Doc)
EPEL repo configuration:
sudo rpm -Uvh http://mir01.syntis.net/epel//7/x86_64/e/epel-release-7-5.noarch.rpm
Installation
yum install pykickstart cobbler cobbler-web
Activate TFTP
vim /etc/xinetd.d/tftp # disable = yes <- Change this line to "no" chkconfig tftp on
Note
Configuration may be different according to Linux breed
Configure the firewall:
# For TFTP: firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p tcp --dport 69 -j ACCEPT firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p udp --dport 69 -j ACCEPT # For HTTP firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p tcp --dport 80 -j ACCEPT firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p tcp --dport 443 -j ACCEPT # For Cobbler XML-RPC firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p tcp --dport 25150 -j ACCEPT firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 -p tcp --dport 25151 -j ACCEPT firewall-cmd --reload
Note
If you want to check these rules are correctly saved:
firewall-cmd --permanent --direct --get-rules ipv4 filter INPUT
(optional) If you want to use command “cobbler replicate”, you have to configure
rsync
$ vi /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable= no # change flags= IPv6 socket_type= stream wait= no user= root server= /usr/bin/rsync server_args= --daemon log_on_failure+= USERID } $ chkconfig rsync on
Note
Help here: http://www.server-world.info/en/note?os=CentOS_6&p=rsync
Cobbler configuration:
vim /etc/cobbler/settings
Change following lines:
# manage_rsync: 0 <---- set to 1 to enable Cobbler's RSYNC management features. # server: 127.0.0.1 <---- set to the real Cobbler ip address. # anamon_enabled: 0 <---- set to 1 to enable Anamon log. # next_server: 127.0.0.1 <---- set to the real Cobbler ip address.
Start Cobbler service:
service cobblerd start chkconfig cobblerd on service httpd start chkconfig httpd on
Download loaders:
cobbler get-loaders
(optional) If you want to change the WEB interface password (cobbler/cobbler):
openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'
And put the key in /etc/cobbler/settings:
# default_password_crypted: "$1$company$prqgnhJ6izx5.S9FVItCB/"
Then change the web user interface setting:
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Sync all:
cobbler sync
Note
You can check your installation with:
cobbler check
Cobbler usage¶
Warning
If you are not familiar with the Cobbler terminology, we strongly advise you to read the glossary :)
General usage¶
When you create a new “system”, Cobbler makes the following operations:
- Reads the profile used by the system to create the installation ISO. The distribution (distro) is defined in the profile.
- Generates the kickstart. The kickstart template is defined in the profile. The template is instantiate with the “profile” and the “system” informations.
- The kickstart template may refer to several snippets.
How to view/modify a profile?¶
Go to Cobbler
Open the “profiles” view:
Choose a profile:
Edit the profile:
The “virtualization” tab allows to set hardware resources:
It may be used with Koan <http://cobbler.github.io/manuals/2.6.0/6/3_-_Installing-virtual-guests.html>_ to deploy virtual machine.
How to view/modify the kickstart?¶
Go to Cobbler
Open the “Kickstart Templates” view:
Choose the kickstart
Edit the kickstart:
How to view/modify a snippet?¶
Go to Cobbler
Open the “Snippets” view:
Choose a snippet
partitioning.conf
Edit the snippet:
Glossary¶
- distro
- According to the Cobbler terminology, a “distro” is the configuration of an operating system. Ex: RHEL 6.5, Centos 7.2
- kickstart
- A file containing the answers to all the questions that would normally be asked during a typical OS installation (RHEL Linux type). Kickstart provides a way for users to automate any OS installation.
- profile
- A profile contains all configurations of the infrastructure and the platform (distro, CPU, RAM, Disk...). It’s like a model/template that can be refered by a system.
- snippet
- Snippets are a way of reusing common blocks of code between kickstarts. Its may be seen as function/macro. A snippet is saved in a separate file.
- system
- According the Cobbler terminology, a “system” contains the configuration of a particular machine. In other terms, it is an instance of a profile. For example, it contains specific network informations of a machine (IP, gateway, hostname...)
Useful links for Cobbler installation/configuration¶
Installation/Configuration¶
Installation on Redhat : https://access.redhat.com/documentation/en-US/Red_Hat_Network_Satellite/5.3/html/Reference_Guide/ch-cobbler.html#s2-cobbler-reqs-check
Update Cobbler : http://sappyit.blogspot.fr/2015/03/update-cobbler-server.html
Managing DHCP: http://cobbler.github.io/manuals/2.6.0/3/4/1_-_Managing_DHCP.html
Importing a distribution: http://docs.fedoraproject.org/en-US/Fedora/13/html/Installation_Guide/sn-cobbler-import.html
- Usage with Subversion:
http://consultancy.edvoncken.net/index.php/HOWTO_Set_up_a_Subversion_repository_for_provisioning
- Keyring:
- http://technicalprose.blogspot.fr/2011/06/using-subversion-with-gnome-keyring.html
- http://kenneho.net/2011/01/30/using-svn-client-and-gnome-keyring-in-ssh-sessions/
- http://blog.purplecarrot.co.uk/2013/10/subversion-and-gnome-keyring-daemon.html
- http://unix.stackexchange.com/questions/89550/subversion-svn-doesnt-store-passwords-in-gnome-keyring
- http://stackoverflow.com/questions/3824513/svn-encrypted-password-store
Usage¶
- Kickstart:
- Doc: http://cobbler.github.io/manuals/2.6.0/3/5_-_Kickstart_Templating.html
- Making the kickstart file available: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-putkickstarthere.html
- Tips and tricks for anaconda and kickstart: http://wiki.centos.org/fr/TipsAndTricks/KickStart
- Trigger:
- API:
- API XMLRPC: https://fedorahosted.org/cobbler/wiki/CobblerXmlrpc
- API Python: https://fedorahosted.org/cobbler/wiki/CobblerApi
Advice for Software Testing¶
As a tester, if you need to often deploy OS for your testing activity then you shall use Cobbler :-)
Cobbler is a good tool to quickly OS-based test environments and manage their different versions/breeds/configurations.