What is Cobbler, please check Cobbler official website and operation manual .
Installation environment CentOS_6.8_x86_64 (Desktop), Cobbler 2.8.0
Since there is no external network environment, the rpm installation package is used.
rpm package download address: cobbler-2.8.0 , cobbler-web-2.8.0
1. Configure yum local source installation dependencies
mkdir /media/CentOS
mount -t iso9660 /dev/cdrom /media/CentOS
2. Configure the repo file
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS-Vault.repo CentOS-Vault.repo.bak
mv CentOS-Vault.repo CentOS-Vault.repo.bak
cp CentOS-Media.repo CentOS-Media.repo.bak
Modify CentOS-Media.repo, set enabled=1
clear cache
yum clean all
yum makecache
2. Installation dependencies
rpm -i cobbler-2.8.0-17.1.noarch.rpm cobbler-web-2.8.0-17.1.noarch.rpm
Running the above command will report an error showing missing dependencies, for example:
error: Failed dependencies:
redhat-rpm-config is needed by cobbler-2.8.0-17.1.noarch
python-simplejson is needed by cobbler-2.8.0-17.1.noarch
syslinux is needed by cobbler-2.8.0-17.1.noarch
python-cheetah is needed by cobbler-2.8.0-17.1.noarch
PyYAML is needed by cobbler-2.8.0-17.1.noarch
mod_wsgi is needed by cobbler-2.8.0-17.1.noarch
Django >= 1.4 is needed by cobbler-web-2.8.0-17.1.noarch
mod_wsgi is needed by cobbler-web-2.8.0-17.1.noarch
Install according to the missing dependencies.
E.g:
sudo yum install redhat-rpm-config
sudo yum install createrepo
sudo yum install python-simplejson
sudo yum install syslinux
sudo yum install python-cheetah
sudo yum install PyYAML
sudo yum install mod_wsgi
cobbler-web needs to depend on Django, if you don't need a web interface, you can not install Django.
Since there is no Django in the yum repository, it needs to be installed manually. Django-1.5.12 is recommended, click here to download Django-1.5.12 . (A higher version of Django is not recommended, and python2.7 needs to be upgraded. The default python version of CentOS 6.8 is 2.6.6).
Unzip Django.
tar xzvf Django-1.5.12.tar.gz
There is an INSTALL file in the pressurized directory, and install it according to the instructions inside.
python setup.py install
Check if django is installed successfully:
#进入python命令界面
>>> import django
>>> print(django.get_version())
1.5.12
After all dependencies are installed, install cobbler and cobbler-web.
rpm -i cobbler-2.8.0-17.1.noarch.rpm
rpm -i --force --nodeps cobbler-web-2.8.0-17.1.noarch.rpm
Set up SElinux
sudo setsebool -P httpd_can_network_connect true
If SElinux is not set, you may encounter the following error message later:
ProtocolError: <ProtocolError for x.x.x.x:80/cobbler_api: 503 Service Temporarily Unavailable>
Start cobblerd, httpd, and set it to start at boot.
service cobblerd start
chkconfig cobblerd on
service httpd start
service httpd on
Check if it starts
service cobblerd status
service http status
Check if cobbler is installed successfully
$ cobbler check
The following are potential configuration items that you may want to fix:
1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux
4 : missing /etc/xinetd.d/tftp, install tftp-server?
5 : missing configuration file: /etc/xinetd.d/tftp
6 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
7 : change 'disable' to 'no' in /etc/xinetd.d/rsync
8 : Apache (httpd) is not installed and/or in path
9 : debmirror package is not installed, it will be required to manage debian deployments and repositories
10 : ksvalidator was not found, install pykickstart
11 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
12 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
A prompt appears, the installation is successful.
Further setup cobbler-web.
Check the configuration: the following two configurations in /etc/cobbler/modules.conf
[authentication]
module = authn_configfile
[authorization]
module = authz_allowall
Set the web interface login user name cobbler, and enter the password after running the command.
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Open the browser, visit 127.0.0.1:80/cobbler_web, the login page appears, enter the user name cobbler, password. (previously set)
If you log in and encounter the following error
[Errno 13] Permission denied: '/var/lib/cobbler/webui_sessions/sessionid4r8yzmavdexechcw0mta277g5kcfnov3'
The workaround is as follows:
chcon -R -t httpd_cobbler_rw_content_t /var/lib/cobbler/webui_sessions
After re-login, enter the operation interface.