具体步骤:
安装epel
#备份repo
cd /etc/yum.repos.d
mkdir bak
mv *.repo bak/
#下载阿里的repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#安装epel
yum install -y epel-release
#注: 如遇报错:Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
#解决方法将https://mirrors .... 修改为http://mirrors
yum clean all
yum makecache
安装koan并执行重装命令
#安装koan
yum install koan -y
#查看可以重装的系统
[root@localhost ~]# koan --server=192.168.0.10 --list=profiles
- looking for Cobbler at http://192.168.0.10:80/cobbler_api
CentOS-7-x86_64
CentOS-6-x86_64
#重装命令
[root@localhost ~]# koan --replace-self --server=192.168.0.10 --profile=CentOS-6-x86_64
当无法用https://192.168.0.10/cobbler_web/ 登录时 或 获取不到cobbler_api时
#尝试安装低版本的django来解决
#vbox虚拟机需打开443端口
#下载pip.py
wget https://bootstrap.pypa.io/get-pip.py
#调用本地python运行pip.py脚本
python get-pip.py
#安装
pip install Django==1.8.9
pip install ipaddress
systemctl restart tftp
systemctl restart xinetd
systemctl restart httpd
systemctl restart cobblerd
systemctl restart rsyncd
修改cobbler_web登陆密码,并修改cobbler装机提示
#修改密码
cd /etc/cobbler
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
#修改开机提示
vim /etc/cobbler/pxe/pxedefault.template
cobbler sync