Cobbler Automation Installation Linux

Source: Internet
Author: User
Tags openssl rsync

Cobbler批量装系统

1. Introduction
Network installation Server suite Cobbler (cobbler) Once upon a time, we have been working as a promising career for migrant workers. Since Red Hat launched Kickstart a few years ago, we circumnavigated worth more. No longer need to carve a CD a platform to install Linux, as long as the PXE, DHCP, TFTP, and the full screen of the dazzling Kickstart script, we can like Harry Potter, Light magic wand, instantly installed hundreds of servers. This pile of gaudy things can not be the average person can understand, no college education, pass English level four, do not want to play around. In a word, this is a very promising, how technical content of the job ah. Unfortunately, Red Hat's latest (Cobbler project was first released around 2008) released the network installation Server suite Cobbler (cobbler), it has installed the Linux network technology threshold, from the college level of education, success down to junior high school, even the shoemaker can learn. For those of us who have been operating in the installation field for many years, experienced, Laojifuli, Costraint migrant brothers, it is a bolt from the blue.
2, System environment preparation
[Email protected] ~]# cat/etc/redhat-release
CentOS Release 6.7 (Final)
[Email protected] ~]# uname-r
2.6.32-573.el6.x86_64
[[email protected] ~]# ifconfig|awk-f "[:]+" ' nr==2 {print $4} '
192.168.1.131
Add Ali Epel Source
[Email protected] ~]# Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
Prepare the Environment software httpd, DHCP, xinetd, rsync, Pykickstart, Cobbler, and Cobbler-web:
[[email protected] ~]# yum install-y httpd dhcp xinetd rsync pykickstart
[email protected] ~]# Yum install-y Cobbler Cobbler-web
Error: Error:package:cobbler-web-2.6.11-7.git95749a6.el6.noarch (Epel)
Requires:django >= 1.4
Missing dependency Package: Djange,djange Dependency package is Python-simplejson, so
[email protected] ~]# Yum install-y Python-simplejson
[Email protected] ~]# wgethttps://kojipkgs.fedoraproject.org//packages/django14/1.4.14/1.el6/noarch/ django14-1.4.14-1.el6.noarch.rpm
[Email protected] ~]# RPM-IVH django14-1.4.14-1.el6.noarch.rpm
3. Configuration files
[Email protected] ~]#/ETC/INIT.D/HTTPD status
HTTPD (PID 1960) is running ...
[Email protected] ~]#/etc/init.d/cobblerd status
Cobblerd (PID 1948) is running ...
[Email protected] ~]# Cobbler Check #检查cobcler配置
The following is potential configuration items and that's want to fix:
1:the ' server ' field in/etc/cobbler/settings must is set to something other than localhost, or kickstarting features WI ll not work. This should is a resolvable hostname or IP for the boot server as reachable by all machines that would use it.
2:for PXE to be functional, the ' next_server ' field in/etc/cobbler/settings must is set to something other than 127.0.0 .1, and should match the IP of the boot server on the PXE network.
3:change ' disable ' to ' no ' in/etc/xinetd.d/tftp
4:some network boot-loaders is missing from/var/lib/cobbler/loaders, you could run ' cobbler get-loaders ' to download the M, or, if you are want to handle x86/x86_64 netbooting, your may ensure so you have installed arecentVersion of the Syslinux package installed and can ignore this message entirely. Files in this directory, should want to support all architectures, should include pxelinux.0, MENU.C32, Elilo.efi, and Yaboot. The ' Cobbler get-loaders ' command is the easiest-to resolve these requirements.
5:change ' disable ' to ' no ' in/etc/xinetd.d/rsync
6:since Iptables May is running, ensure, 80/443, and 25151 are unblocked
7:debmirror package isn't installed, it'll be required to manage Debian deployments and repositories
8:the default password used by the sample templates for newly installed machines (default_password_crypted IN/ETC/COBBL Er/settings) is still set to ' cobbler ' and should be changed, try: "OpenSSL passwd-1-salt ' Random-phrase-here ' Your-pas Sword-here ' "To generate new one
9:fencing tools were not found, and is 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.
About the problem:
6, the firewall iptables is still running
[Email protected] ~]# Setenforce 0
Setenforce:selinux is disabled
[[Email protected] ~]# service iptables stop
[Email protected] ~]# chkconfig iptables off
[Email protected] ~]# Vim/etc/selinux/config
Selinux=disabled
1, 2, modify the IP address of server,next_server in/etc/cobbler/settings
[Email protected] ~]# sed-i "s/next_server:127.0.0.1/next_server:192.168.1.131/g"/etc/cobbler/settings
[Email protected] ~]# sed-i "s/server:127.0.0.1/server:192.168.1.131/g"/etc/cobbler/settings
Modify cobbler to manage DHCP and TFTP
[Email protected] ~]# sed-i "s/manage_dhcp:0/manage_dhcp:1/"/etc/cobbler/settings
[Email protected] ~]# sed-i "s/manage_rsync:0/manage_rsync:1/g"/etc/cobbler/settings
No duplicate machine is allowed on PXE boot
[Email protected] ~]# sed-i ' s/pxe_just_once:0/pxe_just_once:1/g '/etc/cobbler/settings
8, set the system login root password OpenSSL passwd-1-salt ' guoge ' Your-password-here ' "
[email protected] ~]# OpenSSL passwd-1-salt ' guoge ' 123456 ' # #guoge为干扰内
# #123456为密码
$1$guoge$4kudfv7tavolzgiuxlm2m0
[Email protected] ~]# vim/etc/cobbler/settings
default_password_crypted: "$1$GUOGE$4KUDFV7TAVOLZGIUXLM2M0" # #红色为修改内容

3, 5, modify/etc/xinetd.d/rsync and/etc/xinetd.d/rsync
[Email protected] ~]# sed-i "s/disable = yes/disable = no/g"/etc/xinetd.d/rsync
[[Email protected] ~] #sed-i "s/disable = yes/disa disable = no/g"/etc/xinetd.d/tftp
4, need to use Cobbler get-loaders command download loaders file
[Email protected] ~]# Cobbler Get-loaders
Task Started:2018-07-31_080115_get_loaders
Task started (id=download Bootloader Content, Time=tue Jul 31 08:01:15 2018)
Downloading Http://cobbler.github.io/loaders/README To/var/lib/cobbler/loaders/readme
Downloading Http://cobbler.github.io/loaders/COPYING.elilo To/var/lib/cobbler/loaders/copying.elilo
Downloading Http://cobbler.github.io/loaders/COPYING.yaboot to/var/lib/cobbler/loaders/copying.yaboot
Downloading Http://cobbler.github.io/loaders/COPYING.syslinux to/var/lib/cobbler/loaders/copying.syslinux
Downloading Http://cobbler.github.io/loaders/elilo-3.8-ia64.efi To/var/lib/cobbler/loaders/elilo-ia64.efi
Downloading http://cobbler.github.io/loaders/yaboot-1.3.17 to/var/lib/cobbler/loaders/yaboot
Downloading http://cobbler.github.io/loaders/pxelinux.0-3.86 to/var/lib/cobbler/loaders/pxelinux.0
Downloading http://cobbler.github.io/loaders/menu.c32-3.86 TO/VAR/LIB/COBBLER/LOADERS/MENU.C32
Downloading Http://cobbler.github.io/loaders/grub-0.97-x86.efi To/var/lib/cobbler/loaders/grub-x86.efi
Downloading Http://cobbler.github.io/loaders/grub-0.97-x86_64.efi To/var/lib/cobbler/loaders/grub-x86_64.efi
TASK Complete
The downloaded files are in the/var/lib/cobbler/loaders/
[[email protected] ~]# Cobbler Sync Sync Configuration
Restart Service
[Email protected] ~]#/etc/init.d/xinetd restart
stopping xinetd: [FAILED]
Starting xinetd: [OK]
[Email protected] ~]#/etc/init.d/cobblerd restart
Stopping Cobbler daemon: [OK]
Starting Cobbler daemon: [OK]
[Email protected] ~]# Cobbler Check
The following is potential configuration items and that's want to fix:

1:service DHCPD is not running
2:debmirror package isn't installed, it will be required to manage Debian deployments and repositories # and Debian system-related, no To

3:fencing tools were not found, and is required to use the (optional) power management features. Install Cman or fence-agents to use them # fence device related, no

Restart Cobblerd and then run the ' Cobbler Sync ' to apply changes.
Issue 1, configure and start DHCP
[[email protected] ~]# vim/etc/cobbler/dhcp.template
Subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.131;
Option Domain-name-servers 192.168.1.131;
Option Subnet-mask 255.255.255.0;
Range DYNAMIC-BOOTP 192.168.1.100 192.168.1.254;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $next _server;
[[[email protected] ~]# Cobbler sync sync configuration
Settings boot from:
[[email protected] ~]#/etc/init.d/httpd Restart
[[email protected] ~]#/etc/init.d/xinetd restart
[[email protected] ~]#/ETC/INIT.D/DHCPD Restart
[[email protected] ~]#/etc/init.d/cobblerd restart
[[email protected] ~]# chkconfig--level httpd on
[[email protected] ~]# chkconfig--level + xinetd on
[[email protected] ~]# chkconfig--leve L DHCPD on
[[email protected] ~]# chkconfig--level + cobblerd on

4, set mirror
[[[email protected] ~]# mount/dev/cdrom/mnt/
[[email protected] ~]# Cobbler Import--path=/ mnt/--name=centos-6.7-x86_64--arch=x86_64
[[email protected] ~]# cobbler Sync
[[email protected] ~ ]#/etc/init.d/httpd Restart
[[email protected] ~]#/etc/init.d/xinetd restart
[[email protected] ~] #/ETC/INIT.D/DHCPD Restart
[[email protected] ~]#/etc/init.d/cobblerd Restart
5, KS.CFK file
[email  protected] ~]# cat/var/lib/cobbler/kickstarts/sample_e
sample_end.ks sample_esx4.ks SAMPLE_ESXI4.KS sample _ESXI5.KS
[[email protected] ~]# cat/var/lib/cobbler/kickstarts/sample_e
Sample_end.ks sample_esx4.ks SAMPLE_ESXI4.KS SAMPLE_ESXI5.KS
[[email protected] ~]# cat/var/lib/cobbler/kickstarts/sample_end.ks

# Kickstart template for Fedora 8 and later.# (includes%end blocks) # does not use with earlier distros#platform=x86, AMD64,  or Intel em64t# system authorization Informationauth--useshadow--enablemd5# system bootloader Configurationbootloader --location=mbr# Partition clearing Informationclearpart--all--initlabel# use text mode installtext# Firewall Configurat Ionfirewall--enabled# Run The Setup Agent on first bootfirstboot--disable# system Keyboardkeyboard us# system Languagela ng en_us# Use network Installationurl--url= $tree # If Any cobbler repo definitions were referenced in the Kickstart Profil E, include them here. $yum _repo_stanza# Network information$snippet (' Network_config ') # Reboot after installationreboot# Root passwordrootpw--iscrypted $default _password_crypted# SELinux configurationselinux--disabled# do not configure the X Window systemskipx# System timezonetimezone america/new_york# Install OS instead of upgrade# install# Clear the Master Boot recordzerombr#### AllowAnaconda to partition the system as Neededautopart%pre$snippet (' Log_ks_pre ') $SNIPPET (' Kickstart_start ') $SNIPPET (' Pre _install_network_config ') # # # # # # Enable installation Monitoring$snippet (' Pre_anamon ')%end%packages$snippet (' Func_ Install_if_enabled ')%end%post--nochroot$snippet (' Log_ks_post_nochroot ')%end%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 (' 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%end

View installation image File information
[[Email protected] ~] #cobbler distro report--name=centos-7.1-x86_64
View all profile settings
[Email protected] ~]# Cobbler profile
View the specified profile settings
[[Email protected] ~] #cobbler Profile Report--name=centos-7.1-x86_64
[[email protected] ~]# Cobbler Sync Sync Configuration

6, cobbler-web support Web Login
/ETC/COBBLER/USERS.CONF # Web Service Authorization Profile
/etc/cobbler/users.digest # User name password configuration file for Web Access [[email protected] ~]# cat/etc/cobbler/users.digest
Cobbler:Cobbler:a2d6bae81669d707b72c0bd9806e01f3
Set Cobbler Web user login password
Adding cobbler users in the Cobbler group
[Roo[email protected] ~]# htdigest/etc/cobbler/users.digest "Cobbler" cobbler
Changing password for user cobbler in realm cobbler
New password:123456
Re-type New password:123456
The login address is: Http://192.168.1.131/cobbler_web or Https://192.168.1.131/cobbler_web
Account Password: Cobbler 123456

Reference

http://blog.oldboyedu.com/autoinstall-cobbler/
http://blog.51cto.com/mailfile/1395657
Http://www.mamicode.com/info-detail-2328653.html

Cobbler Automation Installation Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.