#!/bin/bash
Yum-y Install cobbler httpd cobbler-web debmirror Pykickstart
Service Cobblerd Start
Service httpd Start
Cd/etc/cobbler
Sed-i ' [email protected]_server: [email protected]_server: [email protected] ' settings
Sed-i ' [email protected]: [email protected]: [email protected] ' settings
Cobbler Get-loaders
Sed-i ' s/@dists = "Sid";/# @dists = "Sid";/g '/etc/debmirror.conf
Sed-i ' s/@arches = "i386";/# @arches = "i386";/g '/etc/debmirror.conf
OpenSSL passwd-1-salt ' OpenSSL rand-hex 4 ' Redhat
Sed-i ' [email protected]_password_crypted: "$1$mf86/uhc$wvcicx2t6crbz2onwxyac." @default_password_crypted: $1$openssl $GZKb 7lw2hcswj8/oia.v9/@g ' settings
Yum-y Install Cman fence-agents
Service Cobbler Restart
Yum-y Install DHCP
Cd/etc/dhcp
Cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample./dhcpd.conf
Cat > Dhcpd.conf << EOF
Option Domain-name "qiufengsong.com";
Option Domain-name-servers 192.168.3.17,192.168.3.3;
Default-lease-time 33600;
Max-lease-time 37200;
Log-facility Local7;
Subnet 192.168.3.0 netmask 255.255.255.0 {
Range 192.168.3.120 192.168.3.200;
Option routers 192.168.3.17;
}
Next-server 192.168.3.17;
FileName "pxelinux.0";
Eof
Service DHCPD Restart
Mount/dev/cdrom/mnt
Service Cobblerd Restart
Cobbler import--name= ' centos-6.4-x86-64 '--path=/mnt
Cat >/root/ks.cfg << EOF
#platform =x86, AMD64, or Intel EM64T
#version =devel
# Firewall Configuration
Firewall--disabled
# Install OS instead of upgrade
Install
# Use Network Installation
URL--url= "http://192.168.3.17/cobbler/ks_mirror/centos-6.4-x86-64/"
# Root Password
ROOTPW--iscrypted $1$irhppr42$vmesh73wbqhutjkp6oyod.
# System Authorization Information
Auth--useshadow--passalgo=sha512
# Use text mode install
Text
Firstboot--disable
# System Keyboard
Keyboard US
# System Language
Lang en_US
# SELinux Configuration
SELinux--disabled
# Installation Logging Level
Logging--level=info--host=192.168.3.17
# Reboot after installation
Reboot
# System TimeZone
TimeZone Asia/shanghai
# System Bootloader Configuration
Bootloader--append= "RHGB crashkernel=auto quiet"--location=mbr--driveorder= "SDA"
# Clear the Master Boot Record
Zerombr
# Partition Clearing Information
Clearpart--all
# Disk Partitioning Information
Part/boot--FSTYPE=EXT4--size=200
Part pv.008002--size=122679
Volgroup vg_root--pesize=4096 pv.008002
Logvol/--FSTYPE=EXT4--NAME=LOGVG--vgname=vg_root--size=122676
%post
Sed-i ' 1,[email protected]:[0-9]:initdefault: @id: 3:initdefault:@g '/etc/inittab
%end
%packages
@base
@core
@server-policy
%end
Cobbler profile Add--name= "centos.x86_64"--distro=centos-6.4-64-x86_64--kickstart=/root/ks.cfg
Cobbler Sync
Service xinetd Start
This article is from the "→おyǒňɡ Zhi ℃" blog, please be sure to keep this source http://sxlfxx.blog.51cto.com/4244111/1708169
Cobbler Installation Configuration Script