cobbler服务端部署
1. 配置yum源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https:
[root@localhost yum.repos.d]# yum install -y https:
[root@localhost yum.repos.d]# sed -i 's|^#baseurl=https:
[root@localhost yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
2.安装cobbler以及相关的软件
[root@localhost ~]# dnf module enable cobbler:3 -y
[root@localhost ~]# yum -y install httpd dhcp* tftp tftp-server cobbler cobbler-web pykickstart rsync rsync-daemon
3. 启动服务并设置开机自启
systemctl restart httpd;systemctl enable httpd
systemctl restart rsyncd;systemctl enable rsyncd
systemctl restart tftp; systemctl enabled tftp
systemctl restart cobblerd;systemctl enable cobblerd
4.关闭防火墙和selinux
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -ri 's/^(SELINUX=).*/\1disabled/g' /etc/sysconfig/selinux
5. 修改server的ip地址为本机ip
[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.253.136/' /etc/cobbler/settings.yaml
6.设置tftp的ip地址为本机ip
[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.253.136/' /etc/cobbler/settings.yaml
7. 生成加密的密码
[root@localhost ~]# openssl passwd -1 -salt "$RANDOM" 'redhat'
$1$28918$/zM23Txv2uWBkkp4MDXst.
8. 将新生成的加密密码加入到配置文件
[root@localhost ~]# vim /etc/cobbler/settings.yaml
default_password_crypted: "$1$28918$/zM23Txv2uWBkkp4MDXst."
9. 将cobbler的dhcp功能打开
[root@localhost ~]# sed -i "s#manage_dhcp: false#manage_dhcp: true#" /etc/cobbler/settings.yaml
[root@localhost