1.cobbler安装centos7
关闭防火墙和selinux,然后重启
[root@localhost ~]# systemctl disable --now firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
[root@localhost ~]# reboot
//下载epel-release源和相关软件
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install httpd dhcp-* tftp xinetd pykickstart
//开启cobbler仓库,下载cobbler
[root@localhost ~]# yum -y install module enable cobbler
[root@localhost ~]# yum -y install cobbler cobbler-web
//启动httpd、cobbler服务并设置开机自启
[root@localhost ~]# systemctl enable --now httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable --now cobblerd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.
[root@localhost ~]# ss -anltu
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 *:68 *:*
tcp LISTEN 0 128 *:22 *:*
tcp LISTEN 0 100 127.0.0.1:25 *:*
tcp LISTEN 0 5 127.0.0.1:25151 *:*
tcp LISTEN 0 128 [::]:80 [::]:*
tcp LISTEN 0 128 [::]:22 [::]:*
tcp LISTEN 0 100 [::1]:25 [::]:*
tcp LISTEN 0 128 [::]:443 [::]:*
//更改配置文件IP为本机IP
[root@localhost ~]# sed -i 's/^server:.*/server: 192.168.237.131/g' /etc/cobbler/settings
[root@localhost ~]# sed -i 's/^next_server:.*/next_server: 192.168.237.131/g' /etc/cobbler/settings
//生成加密密码替换到配置文件中
[root@localhost ~]# openssl passwd -1
Password:
Verifying - Password:
$1$sR6svS4Z$KyyERbkBKwqXaU82PPsYJ.
[root@localhost ~]# sed -Ei 's/(default_password_crypted:).*/\1 "$1$sR6svS4Z$KyyERbkBKwqXaU82PPsYJ."/g' /etc/cobbler/settings
//同步设置
[root@localhost ~]# cobbler sync
//启动rsync服务并开机自启
[root@localhost ~]# systemctl enable --now rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
//重启cobbler服务,配置tftp
[root@localhost ~]# systemctl restart cobblerd.service
[root@localhost ~]# tail -14 /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -B 1380 -v -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
//执行检查环境命令
[root@localhost ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : Some network boot-loaders are miss