Centos6.5 install cobbler
1. installation script
# Yum-y install wget
# Wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Rpm-ivh epel-release-6-8.noarch.rpm
#/Etc/cobbler/dhcp. template
Yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes python-simplejson-y
Sed-I '/disable/c \ tdisable \ t = no'/etc/xinetd. d/tftp
Sed-I-e's/\=\ yes/\=\ no/G'/etc/xinetd. d/rsync
Sed-I-e's/# ServerName www.example.com: 80/ServerName 192.168.1.231: 80/G'/etc/httpd/conf/httpd. conf
Chkconfig ip6tables off
Chkconfig iptables off
/Etc/init. d/ip6tables stop
/Etc/init. d/iptables stop
Sed-I's/next_server: 127.0.0.1/next_server: 192.168.1.231/G'/etc/cobbler/settings
Sed-I's/bind_master: 127.0.0.1/bind_server: 192.168.1.231/G'/etc/cobbler/settings
Sed-I's/manage_rsync: 0/manage_rsync: 1/G'/etc/cobbler/settings
Sed-I's/manage_dhcp: 0/manage_dhcp: 1/G'/etc/cobbler/settings
Sed-I's/SELINUX = enforcing/SELINUX = disabled/'/etc/selinux/config
Setenforce 0
Service httpd restart
/Etc/init. d/cobblerd restart
/Etc/init. d/xinetd restart
Cobbler get-loaders
Mount-o loop/dev/cdrom/mnt/c6.5/
Cobbler import -- path =/mnt/c6.5/-- name = centos-server-6.5-i386
Cobbler distro list
/Var/www/cobbler/ks_mirror/
Cobbler profile edit -- name = centos6.5 -- distro = centos-server-6.5-i386 -- kickstart =/var/lib/cobbler/kickstarts/c6.ks
Cobbler sync
Dhcp Configuration
Subnet 192.168.1.0 netmask 255.255.255.0 {
Option routers 192.168.1.1;
Option domain-name-servers 202.106.0.20;
Option subnet-mask limit 255.0;
Range dynamic-bootp 192.168.1.10 192.168.1.50;
Filename "/pxelinux.0 ";
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $ next_server;
}
Service network restart
2. c6.ks
# Platform = x86, AMD64, or Intel EM64T
# System authorization information
Auth -- useshadow -- enablemd5
# System bootloader configuration
Bootloader -- location = mbr
# Use text mode install
Lang zh_CN.UTF-8
# Langsupport zh_CN.UTF-8 en_US -- default = en_US
Keyboard us
# Mouse generic3ps/2
Timezone Asia/Shanghai
Install
Url -- url = http: // 192.168.1.231/cobbler/ks_mirror/centos-server-6.5-i386
Text
# Zerombr yes
# Partition clearing information
# Clearpart -- all
Clearpart -- all -- initlabel
# Partition clearing information
Part/boot -- fstype ext4-size = 100
Part swap -- size = 2048
Part pv.01 -- size = 1 -- grow
Volgroup vg_root pv.01
Logvol/-- fstype = ext4 -- name = lv_root -- vgname = vg_root -- size = 20480
Network -- bootproto static -- device eth0 -- ip 192.168.1.45 -- netmask 255.255.255.0 -- gateway = 192.168.1.1 -- noipv6 -- hostname cobbler # network -- bootproto = dhcp -- device = eth0 -- onboot = on
Firewall -- disabled
Selinux -- disabled
Skipx
# Network information
# --- Reboot the host after installation is done
Reboot
# Root password
Rootpw 123456
% Pre
$ SNIPPET ('Log _ ks_pre ')
$ SNIPPET ('kickstart _ start ')
$ SNIPPET ('pre _ install_network_config ')
% Packages
@ Base
@ Core
% Post
$ SNIPPET ('Log _ ks_post ')
# Start yum configuration
$ Yum_config_stanza
# End yum configuration
$ SNIPPET ('Post _ install_kernel_options ')
# $ SNIPPET ('Post _ install_network_config ')
Echo "NETWORKING = yes">/etc/sysconfig/network
Echo "NETWORKING_IPV6 = no">/etc/sysconfig/network
Echo "HOSTNAME = cobbler">/etc/sysconfig/network
Echo "nameserver 192.168.1.1">/etc/resolv. conf
Echo "nameserver 202.106.0.20">/etc/resolv. conf
For service in 'chkconfig -- list | awk '{print $1}' | egrep-v "^ $" | awk-F ":" '{print $1 }''; do chkconfig $ service off; done
For service in crond sshd syslog network; do chkconfig $ service on; done
Ulimit-HSn 65535
# Start final steps
$ SNIPPET ('kickstart _ done ')
# End final steps
# Wgethttp: // 192.168.1.231/lamp can put the script here
# Sh lamp
Refer to dl528888 blog http://dl528888.blog.51cto.com/
This article from the "A sky empty" blog, please be sure to keep this source http://szgb2014.blog.51cto.com/340201/1625243