Cobbler自动部署CentOS系统
2017-12-15 11:17
330 查看
Cobbler自动部署CentOS系统:
说明:Cobbler相当于kickstart的2次封装,主要解决kickstart不能多系统部署的问题
建议在Ubuntu 14.04系统上搭建,Ubuntu 16.04上会有apache2的python和mod_wsgi模块版本冲突
安装apache2、tftpd-hpa、kickstart略
apt-get install cobbler
netstat -ntplu (查看服务端口,包括tcp和udp)
curl -I http://127.0.0.1/cobbler (验证网页是否能打开)
cobbler check
apt-get install debmirror
cp -rv /usr/share/doc/debmirror/examples/debmirror.conf /etc/
vi /etc/debmirror.conf (注释掉下面2行)
#@dists="precise";
#@arches="i386";
:wq
service cobbler restart
cobbler sync
echo "xxxx" | openssl passwd -1 -stdin (此次xxxx为客户端的root初始密码)
vi /etc/cobbler/settings (将上补生成的乱码贴进去)
default_password_crypted: "$1$cobbler$nBCRhq3fBRuMs35Rp4EUX/"
:wq
cobbler sync
导入iso镜像
mount -t iso9660 -r -o ro,loop CentOS-6.5-x86_64-bin-DVD1.iso /root/iso/
cobbler import --name=CentOS65 --arch=x86_64 --path=/root/iso
cobbler list
cobbler distro list
cobbler profile list
cobbler profile report --name=CentOS65-x86_64 #查看profile设置
cobbler distro report --name=CentOS65-x86_64 #查看安装镜像文件信息
cobbler profile remove --name=CentOS65-x86_64 #移除profile
cobbler profile add --name=CentOS65-x86_64 --distro=CentOS65-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS65-x86_64.ks #添加
cobbler profile edit --name=CentOS65-x86_64 --distro=CentOS65-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS65-x86_64.ks #编辑
将kickstart生成的ks.cfg拷至cobbler的kickstarts目录下
cp -rv /var/www/html/ks/ks.cfg /var/lib/cobbler/kickstarts/centos65.ks
vi /var/lib/cobbler/kickstarts/centos65.ks
url --url http://10.0.0.2/cobbler/ks_mirror/CentOS65-x86_64
:wq
cobbler profile add --name=CentOS65-x86_64 --kickstart="/var/lib/cobbler/kickstarts/centos65.ks"
cobbler profile getks --name CentOS65-x86_64 查看centos65.ks内容(等同于cat centos65.ks)
cobbler profile report
service cobbler restart
cobbler sync
centos65.ks内容:
#Generated by Kickstart Configurator
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone America/New_York
#Root password
rootpw --disabled
#Initial user
user super --fullname "super" --iscrypted --password $1$.ljIjOMi$vFieciSvR.iGv3uyiVV9D1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://10.0.0.2/ks
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part / --fstype ext4 --size 50000 --asprimary
part swap --size 20000 --asprimary
part /boot/efi --fstype vfat --size 1000 --asprimary
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=em1
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
说明:Cobbler相当于kickstart的2次封装,主要解决kickstart不能多系统部署的问题
建议在Ubuntu 14.04系统上搭建,Ubuntu 16.04上会有apache2的python和mod_wsgi模块版本冲突
安装apache2、tftpd-hpa、kickstart略
apt-get install cobbler
netstat -ntplu (查看服务端口,包括tcp和udp)
curl -I http://127.0.0.1/cobbler (验证网页是否能打开)
cobbler check
apt-get install debmirror
cp -rv /usr/share/doc/debmirror/examples/debmirror.conf /etc/
vi /etc/debmirror.conf (注释掉下面2行)
#@dists="precise";
#@arches="i386";
:wq
service cobbler restart
cobbler sync
echo "xxxx" | openssl passwd -1 -stdin (此次xxxx为客户端的root初始密码)
vi /etc/cobbler/settings (将上补生成的乱码贴进去)
default_password_crypted: "$1$cobbler$nBCRhq3fBRuMs35Rp4EUX/"
:wq
cobbler sync
导入iso镜像
mount -t iso9660 -r -o ro,loop CentOS-6.5-x86_64-bin-DVD1.iso /root/iso/
cobbler import --name=CentOS65 --arch=x86_64 --path=/root/iso
cobbler list
cobbler distro list
cobbler profile list
cobbler profile report --name=CentOS65-x86_64 #查看profile设置
cobbler distro report --name=CentOS65-x86_64 #查看安装镜像文件信息
cobbler profile remove --name=CentOS65-x86_64 #移除profile
cobbler profile add --name=CentOS65-x86_64 --distro=CentOS65-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS65-x86_64.ks #添加
cobbler profile edit --name=CentOS65-x86_64 --distro=CentOS65-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS65-x86_64.ks #编辑
将kickstart生成的ks.cfg拷至cobbler的kickstarts目录下
cp -rv /var/www/html/ks/ks.cfg /var/lib/cobbler/kickstarts/centos65.ks
vi /var/lib/cobbler/kickstarts/centos65.ks
url --url http://10.0.0.2/cobbler/ks_mirror/CentOS65-x86_64
:wq
cobbler profile add --name=CentOS65-x86_64 --kickstart="/var/lib/cobbler/kickstarts/centos65.ks"
cobbler profile getks --name CentOS65-x86_64 查看centos65.ks内容(等同于cat centos65.ks)
cobbler profile report
service cobbler restart
cobbler sync
centos65.ks内容:
#Generated by Kickstart Configurator
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone America/New_York
#Root password
rootpw --disabled
#Initial user
user super --fullname "super" --iscrypted --password $1$.ljIjOMi$vFieciSvR.iGv3uyiVV9D1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://10.0.0.2/ks
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part / --fstype ext4 --size 50000 --asprimary
part swap --size 20000 --asprimary
part /boot/efi --fstype vfat --size 1000 --asprimary
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=em1
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
相关文章推荐
- 使用centos6.6部署Cobbler--自动安装centos系统
- Centos 部署Cobbler系统
- Cobbler无人值守全自动安装部署Linux系统
- 基于Cobbler实现多版本系统自动部署
- 实战:Cobbler 无人值守自动部署系统
- Cobbler自动批量部署CentOS 6和CentOS 7
- Cobbler之自动部署系统
- Cobbler自动部署主机系统
- Centos 部署Cobbler系统
- Cobbler自动批量部署不同需求的系统
- Cobbler 2.9+EFI自动化部署CentOS系统
- CentOS7 安装cobbler自动部署ubuntu
- CentOS7 利用Cobbler安装部署centos系统
- 基于cobbler完成自动批量部署centos
- Cobbler自动部署主机系统
- Centos6.5_salt自动部署zabbix_agentd(二)-- 部署windows以及linux系统
- Cobbler自动部署主机系统-扩展
- Cobbler自动部署主机系统
- Cobbler自动化批量部署CentOS6.5系统
- kickstart+centos6.5+DHCP+TFTP+HTTP 实现自动部署系统