Recently, I have studied the cobbler batch installation system.
The cobbler installation system is an upgraded version of kickstart earlier. It has the advantages of easy configuration and easy management on its own web interface. The disadvantage is that there are few Chinese materials.
Here we will introduce in detail the installation process I personally experienced.
At the beginning, I used the centos 5.8 system, but reported an error when installing cpbbler-web. So this time I used the centos6.4 System for installation and configuration.
Environment:
Operating System: CentOS 6.4
Ip address of the testing machine: 10.0.0.128
Disable iptables selinux first.
/Etc/init. d/iptables stop
Chkconfig iptables off
Setenforce0
And modify the configuration file/etc/sysconfig/selinux to disable it.
1. Import the yum source and install the software.
|
Rpm-Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
Yum install cobbler-web
Yum install dhcp httpd
Chkconfig cobblerd on
Chkconfig httpd on
Cobbler check |
Ii. Configure the environment
1> modify the cobbler configuration file
Vi/etc/cobbler/settings
Modify the settings as follows:
|
Next_server: 10.0.0.128
Server: 10.0.0.128
Manage_dhcp: 1
Manage_rsync: 1 |
Generate password string
[Root @ puppet ~] # Openssl passwd-1-salt "cobber" "123456" # A simple example "123456"
$1 $ cobber $ yV9XfOuaaiVDvImopK7o. 1
Openssl passwd-1-salt 'any character 'Password'
You can write any character for this command. This password is the root password after the system is installed. Replace the string in the configuration file.
Vi/etc/cobbler/settings
Default_password_crypted: "$1 $ cobber $ yV9XfOuaaiVDvImopK7o. 1"
2> enable tfpt and rsync
Vim/etc/xinetd. d/tftp
Vim/etc/xinetd. d/rsync
Change the disable value to no.
Start the service
/Etc/init. d/xinetd restart
3> modify the dhcp configuration file
# Vi/etc/cobbler/dhcp. template
|
Ddns-update-style interim;
Allow booting;
Allow bootp;
Ignore client-updates;
Set vendorclass = option vendor-class-identifier;
Option pxe-system-type code 93 = unsigned integer 16;
Subnet 10.0.0.0 netmask 255.255.255.0 {
Option routers 10.0.0.1;
Option domain-name-servers 8.8.8.8;
Option subnet-mask limit 255.0;
Range dynamic-bootp 10.0.0.2 10.0.0.100;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $ next_server;
}
|
For the remaining default values, you only need to modify this template. cobbler will synchronize to the dhcp configuration.
[Root @ cobbler ~] # Cobbler get-loaders
|
Task started: 2014-03-25_163306_get_loaders
Task started (id = Download Bootloader Content, time = Tue Mar 25 16:33:06 2014)
Path/var/lib/cobbler/loaders/README already exists, not overwriting existing content, use -- force if you wish to update
Path/var/lib/cobbler/loaders/COPYING. elilo already exists, not overwriting existing content, use -- force if you want to update
Path/var/lib/cobbler/loaders/COPYING. Yt T already exists, not overwriting existing content, use -- force if you want to update
Path/var/lib/cobbler/loaders/COPYING. syslinux already exists, not overwriting existing content, use -- force if you want to update
Path/var/lib/cobbler/loaders/elilo-ia64.efi already exists, not overwriting existing content, use -- force if you wish to update
Downloading http://www.cobblerd.org/loaders/yaboot-1.3.14-12 to/var/lib/cobbler/loaders/yaboot
Downloading http://www.cobblerd.org/loaders/pxelinux.0-3.61 to/var/lib/cobbler/loaders/pxelinux.0
Downloading http://www.cobblerd.org/loaders/menu.c32-3.61 to/var/lib/cobbler/loaders/menu. c32
Downloading http://www.cobblerd.org/loaders/grub-0.97-x86.efi to/var/lib/cobbler/loaders/grub-x86.efi
Downloading http://www.cobblerd.org/loaders/grub-0.97-x86_64.efi to/var/lib/cobbler/loaders/grub-x86_64.efi
* ** Task complete *** |
3. Configure the web Environment
# Vi/etc/cobbler/modules. conf
Module = authn_configfile/change the Authentication mode to the password file type
# Htdigest/etc/cobbler/users. digest "Cobbler" cobbler/Add a cobbler user and prompt to enter the password twice for confirmation
# Cobbler sync/output *** task complete *** indicates no configuration error
#/Etc/init. d/httpd restart
#/Etc/init. d/cobblerdrestart
Access the web page https: // 10.0.0.128/cobbler_web/log on with the user you just created
1: Add a DVD source,
[Root @ puppet soft] # mount/dev/cdrom/mnt/cdrom/
Cobbler import -- path =/mnt/cdrom -- name = centos6.4
[Root @ cobbler ~] # Cobblerimport -- path =/mnt/cdrom -- name = centos6.4
|
Task started: 2014-03-25_182605_import
Task started (id = Media import, time = Tue Mar 25 18:26:05 2014)
Found a candidate signature: breed = redhat, version = rhel6
Found a matching signature: breed = redhat, version = rhel6
Adding distros from path/var/www/cobbler/ks_mirror/centos6.4:
Creating new distro: centos6.4-i386
Trying symlink:/var/www/cobbler/ks_mirror/centos6.4->/var/www/cobbler/links/centos6.4-i386
Creating new profile: centos6.4-i386
Associating repos
Checking for rsync repo (s)
Checking for rhn repo (s)
Checking for yum repo (s)
Starting descent into/var/www/cobbler/ks_mirror/centos6.4 for centos6.4-i386
Processing repo at:/var/www/cobbler/ks_mirror/centos6.4
Need to process repo/comps:/var/www/cobbler/ks_mirror/centos6.4
Looking for/var/www/cobbler/ks_mirror/centos6.4/repodata/* comps *. xml
Running: createrepo-c cache-s sha -- groupfile/var/www/cobbler/ks_mirror/centos6.4/repodata/empty/var/www/cobbler/ks_mirror/centos6.4
Received on stdout: Spawning worker 0 with 3114 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
Received on stderr:
* ** Task complete *** |
For graphic interface operations, click Importer DVD (attach the image ISO first), then Importer, and click run
After the import is complete, you can see
Select the profile configuration ks file on the left
Enter the required ks file path
The Centos6.ks file is as follows. Here is just a simple ks file. You can configure it as needed.
|
# Platform = x86, AMD64, or Intel EM64T
# System authorization information
Auth -- useshadow -- enablemd5
# System bootloader configuration
Bootloader -- location = mbr
# Partition clearing information
Clearpart -- all -- initlabel
# Use text mode install
Text
# Firewall configuration
Firewall -- disable
# Run the Setup Agent on first boot
Firstboot -- disable
# System keyboard
Keyboard us
# System language
Lang en_US
# Use network installation
Url -- url = $ tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$ Yum_repo_stanza
# Network information
$ SNIPPET ('network _ config ')
# Reboot after installation
Reboot
# Root password
Rootpw -- iscrypted $ default_password_crypted
# SELinux configuration
Selinux -- disabled
# Do not configure the X Window System
Skipx
# System timezone
Timezone -- utc Asia/Shanghai
# Install OS instead of upgrade
Install
# Clear the Master Boot Record
Zerombr
# Allow anaconda to partition the system as needed
Autopart
Clearpart -- all -- drives = sda -- initlabel
Part/boot -- fstype ext3 -- size = 200
Part/-- fstype ext3 -- size = 8000
Part swap -- size = 2048
% Pre
$ SNIPPET ('Log _ ks_pre ')
$ Kickstart_start
$ SNIPPET ('pre _ install_network_config ')
# Enable installation monitoring
$ SNIPPET ('pre _ anamon ')
% Packages
@ Admin-tools
@ Base
@ Chinese-support
@ Core
@ Development-libs
@ Development-tools
@ Editors
@ System-tools
@ Text-internet
OpenIPMI-tools
Hardlink
Kernel-PAE
Kernel-PAE-devel
Kernel-devel
Libpng-devel
Lrzsz
Minicom
Net-snmp-utils
Pcre-devel
Sysstat
X86info
Puppet
% Pre
$ SNIPPET ('Log _ ks_pre ')
$ SNIPPET ('kickstart _ start ')
$ SNIPPET ('pre _ install_network_config ')
# Enable installation monitoring
$ SNIPPET ('pre _ anamon ')
% Packages
$ SNIPPET ('func_install_if_enabled ')
$ SNIPPET ('puppet _ install_if_enabled ')
% Post
$ SNIPPET ('Log _ ks_post ')
# Start yum configuration
$ Yum_config_stanza
# End yum configuration
$ SNIPPET ('Post _ install_kernel_options ')
$ SNIPPET ('Post _ install_network_config ')
$ SNIPPET ('func_register_if_enabled ')
$ SNIPPET ('puppet _ register_if_enabled ')
$ SNIPPET ('Download _ config_files ')
$ SNIPPET ('koan _ environment ')
$ SNIPPET ('redhat _ register ')
$ SNIPPET ('cobbler _ register ')
# Enable post-install boot notification
$ SNIPPET ('Post _ anamon ')
# Start final steps
$ SNIPPET ('kickstart _ done ')
# End final steps
|
5: after the client starts from the network, select the corresponding project file to start automatic deployment.
Select the configured option to start Automatic Installation
After the restart is completed, you can use the previously defined password ("123456") to log on.
Appendix: troubleshooting
# Cobbler check
The following are potential configuration items that you may be want to fix:
1: Must enable a selinux boolean to enable vital web services components, run: setsebool-P httpd_can_network_connect true
2: you need to set some SELinux content rules to ensure cobbler serves available in your SELinux environment, run the following:/usr/sbin/semanagefcontext-a-t external "/tftpboot /. * "&/usr/sbin/semanage fcontext-a-t public_content_t"/var/www/cobbler "/images /. *
3: you need to set some SELinux rules if you want to use cobbler-web (anoptional package), run the following: /usr/sbin/semanage fcontext-a-thttpd_sys_content_rw_t "/var/lib/cobbler/webui_sessions /. *"
Solution: Disable selinux.
# Vim/etc/sysconfig/selinux
SELINUX = disabled
4: change 'disable' to 'no' in/etc/xinetd. d/tftp
Solution: edit the/etc/xinetd. d/tftp file and change the disable field configuration in the file from yes to no.
5: change 'disable' to 'no' in/etc/xinetd. d/rsync
Solution: edit the/etc/xinetd. d/rsync file and change the disable field configuration in the file from yes to no.
6: since iptables may be running, ensure 69, 80, and 25151 are unblocked
Solution: Enable ports 25151, 80, and in iptables. If it is only used in the internal environment, we recommend that you disable the firewall directly.
7: debmirror package is not installed, it will be required to manage debiandeployments and repositories
Solution: yum install debmirror
Or: rpm-Uvhftp: // rpmfind.net/linux/epel/5/ I #/debmirror-20090807-1.el5.noarch.rpm-nodeps-force
8: ksvalidator was not found, install pykickstart
Solution: yum install pykickstart
9: The default password used by the sample templates for newly installedmachines (default_password_crypted in/etc/cobbler/settings) is still set to 'jobbler' and shocould be changed, try: "openssl passwd-1-salt 'random-phrase-here ''ur-password-here '" to generate new one
Solution: change the default password and write the password to/etc/cobbler/settings.
# Openssl passwd-1-salt 'random-phrase-here ''your-password-here'
10: comment 'dists 'on/etc/debmirror. conf for proper debian support
11: comment 'archies' on/etc/debmirror. conf for proper debian support
Solution: Comment on the two lines below/etc/debmirror. conf.
# @ Dists = "sid ";
@ Sections = "main, main/debian-installer, contrib, non-free ";
# @ Arches = "i386 ";
12: fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Solution: yum install cman
After the repair is completed, check the problem with cobbler check and use cobbler sync for synchronization:
# Cobbler check
No configuration problems found. All systems go.
13. comment out 'dists 'on/etc/debmirror. conf for proper debian support
Comment out 'archies' on/etc/debmirror. conf for proper debiansuppvim Vim vi/etc/debmirror. conf
# Comment out @ dists = "sid" and @ arches = "i386.
# @ Dists = "sid ";
# @ Arches = "i386 ";
14. cobbler check error compared
Traceback (most recent call last ):
File "/usr/bin/cobbler", line 35, in?
Sys. exit (app. main ())
File "/usr/lib/python2.4/site-packages/cobbler/cli. py", line 558, in main
Rc = cli. run (sys. argv)
File "/usr/lib/python2.4/site-packages/cobbler/cli. py", line 202, in run
Self. token = self. remote. login ("", self. shared_secret)
File "/usr/lib64/python2.4/xmlrpclib. py", line 1096, in _ call __
Return self. _ send (self. _ name, args)
File "/usr/lib64/python2.4/xmlrpclib. py", line 1383, in _ request
Verbose = self. _ verbose
File "/usr/lib64/python2.4/xmlrpclib. py", line 1147, in request
Return self. _ parse_response (h. getfile (), sock)
File "/usr/lib64/python2.4/xmlrpclib. py", line 1286, in _ parse_response
Return u. close ()
File "/usr/lib64/python2.4/xmlrpclib. py", line 744, in close
Raise Fault (** self. _ stack [0])
Xmlrpclib. Fault: <Fault 1: "cobbler. cexceptions. CX: 'login failed'">
Solution: This is a BUG. follow the steps below to execute
Service cobblerd restart
Cobbler get-loaders
The returned result is OK.