Chinaunix首页 | 论坛 | 博客
  • 博客访问: 67962
  • 博文数量: 9
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 322
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-23 18:11
个人简介

不去尝试的人永远不会成功,相信自己,力量就在心中!

文章分类

全部博文(9)

分类: 系统运维

2015-06-19 15:01:04

cobbler服务器:172.16.32.204

epel源安装
#rpm -ivh

httpd cobbler tftp rsync xinetd dhcp 服务安装配置
#yum install httpd cobbler tftp rsync xinetd dhcp

httpd配置启动
#sed -i 's@#ServerName 127.0.0.1:80@g' /etc/httpd/conf/httpd.conf
#service httpd start

cobbler配置启动
#sed -i 's@next_server: 127.0.0.1@next_server: 172.16.32.204@g' /etc/cobbler/settings
#sed -i 's@server: 127.0.0.1@server: 172.16.32.204@g' /etc/cobbler/settings
#cobbler get-loaders
#cobbler check
#cobbler rsync
#sed -i 's/server: 127.0.0.1/server: 172.16.32.204/g' /etc/cobbler/settings

修改tftp、rsync
#sed -i '/disable/s/yes/no/g' /etc/xinetd.d/tftp
#sed -i '/disable/s/yes/no/g' /etc/xinetd.d/rsync
#chmod +x /etc/xinetd.d/tftp
#/etc/init.d/xinetd start

配置安装系统完成后的root登录密码
#openssl passwd -1 -salt 'random-phrase-here' '123456'
$1$random-p$l6ql01dDk1EZE0cx0qflR0
#vim /etc/cobbler/settings #将上面红色字符,生成的密码写入此配置文件指定位置
default_password_crypted:  "$1$random-p$l6ql01dDk1EZE0cx0qflR0"

安装pykickstart
#yum -y install cman pykickstart
#/etc/init.d/cobblerd restart
#cobbler check
#cobbler sync

配置DHCP服务
#vim /etc/dhcp/dhcpd.conf #配置内容如下
ddns-update-style interim;
ignore client-updates;
subnet 172.16.32.0 netmask 255.255.255.0;
#-----default gateway
option routers 172.16.32.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 202.206.0.20;
option time-offset -18000;
range dynamic-bootp 172.16.32.5 172.16.32.10;
filename "pxelinux.0";
next-server 172.16.32.204;
default-lease-time 21600;
max-lease-time 43200;

#/etc/init.d/dhcpd start

上传系统ios,建立系统挂载目录导入系统镜像
#mkdir -p /data/ISO/linux/{redhat-x64,centos-x64}
#mount -o loop /data/ISO/CentOS-6.5-x86_64-bin-DVD1.iso /data/ISO/linux/centos-x64/
#mount -o loop /data/ISO/rhel-server-6.5-x86_64-dvd.iso /data/ISO/linux/redhat-x64/

导入系统镜像
#cobbler import --path=/data/ISO/linux/centos-x64/ --name=centos-6.5 --arch=x86_64
#cobbler import --path=/data/ISO/linux/redhat-x64/ --name=redhat-6.5 --arch=x86_64

自定义ks.cfg文件(此处redhat6u5.cfg和centos6u5.cfg为自定义文件,放入/var/lib/cobbler/kickstarts/目录中)
#cobbler profile edit --name redhat-6.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/redhat6u5.cfg
#cobbler profile edit --name centos-6.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6u5.cfg
redhat6u5.cfg文件内容如下:
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=$tree
# Root password
rootpw --iscrypted $1$J3Qsy6SY$NshqUKbe37plRw7UxPqV00
# System authorization information
auth  --useshadow  --passalgo=md5
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone  Asia/Shanghai
# Network information
##network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="ext4" --size=200
part swap --asprimary --fstype="swap" --size=20480
part / --fstype="ext4" --size=40000
part /data --asprimary --fstype="ext4" --grow --size=1

%packages
@additional-devel
@chinese-support
@development
@dial-up
@network-file-system-client
@network-tools
@scalable-file-systems
@server-platform-devel
@system-management-snmp
@x11
cjkuni-fonts-ghostscript
cmake
compat-gcc-34
compat-gcc-34-c++
compat-gcc-34-g77
cvs-inetd
expect
gcc-gnat
gcc-java
gcc-objc
gcc-objc++
java-1.8.0-openjdk-devel
jpackage-utils
libXau-devel
# Reboot after installation
reboot
# System timezone
timezone  Asia/Shanghai
# Network information
##network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="ext4" --size=200
part swap --asprimary --fstype="swap" --size=20480
part /data --fstype="ext4" --size=400000
part / --asprimary --fstype="ext4" --grow --size=1

%packages
@additional-devel
@chinese-support
@development
@dial-up
@network-file-system-client
@network-tools
@scalable-file-systems
@server-platform-devel
@system-management-snmp
@x11
cjkuni-fonts-ghostscript
cmake
compat-gcc-34

centos6u5.cfg 文件同上

创建PXE菜单密码(安装系统时需要输入的密码,密码为lixuan123)
#openssl passwd -1 -salt 9P@42K1 lixuan123
$1$9P@42K1$nK6e28FmzhXAoVKTp3afG1

#vim /etc/cobbler/pxe/pxedefault.template #将上面生成的加密密码添加到此文件中
MENU TITLE LiXuan() Automation Install System  #自定义title
MENU MASTER PASSWD $1$9P@42K1$nK6e28FmzhXAoVKTp3afG1
#vim /etc/cobbler/pxe/pxeprofile.template  #修改内容如下红色部分
LABEL $profile_name
        MENU PASSWD
        kernel $kernel_path
        $menu_label
        $append_line
        ipappend 2


#cobbler check
#cobbler sync

为了能使cobbler通过web页面登录管理,安装cobbler-web
#yum -y install cobbler-web

建立cobbler用户和密码
#htdigest /etc/cobbler/users.digest "Cobbler" cobbler  #回车键提示输入密码

配置cobbler-web 可以登陆
#sed -i 's/authn_denyall/authn_configfile/g' /etc/cobbler/modules.conf
#/etc/init.d/cobblerd restart
#/etc/init.d/httpd restart

登陆cobbler-web

用户名:cobbler
密码:cobbler


阅读(2514) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~