Table of Contents
配置 chrony 服务实现服务器时间自动同步
安装 chrony 软件
yum install chrony -y
配置 chrony
vim /etc/chrony.conf # 把时间服务器改为国内的 server ntp.aliyun.com iburst
启动服务
# 现在启动 systemctl start chronyd # 开机自启 systemctl enable chronyd
实现 cobbler+pxe 自动化装机
安装 cobbler,tftp,dhcp,httpd
yum install cobbler dhcpd tftp -y
配置 dhcp
vim /etc/cobbler/dhcp.template subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.10.7; # 改为本机 option domain-name-servers 192.168.10.7; # 改为本地域名服务器 option subnet-mask 255.255.255.0; # 改为当前子网掩码 range dynamic-bootp 192.168.10.100 192.168.10.254; # 设定dhcp分配范围
配置 cobbler
default_password_crypted: "<用 =openssl passwd -1= 生成的密码>" server: 192.168.10.7 next_server: 192.168.10.7 #cobbler自动生成dhcp文件 manage_dhcp:1 manage_tftpd:1 pxe_just_once:1
挂载 centos 光盘
mount /dev/sr0 /var/www/html
- 下载启动菜单
cobbler get-loaders
cobbler sync
- 创建 yum 源
cobbler immport --name=centos7 --path=/var/www/html
配置 kickstart 文件放在/var/www/html 下(可选)
yum install system-config-kickstart # 生成kickstart文件 system-config-kickstart # 移动 cp xxx.cfg /var/lib/cobbler/kickstarts/ # 更改 vim /var/lib/cobbler/kickstarts/xxx.cfg # url --url=$tree # 将安装配置加入cobbler cobbler profile add --name=centos7-minimal --distro=centos7 --kickstart /var/lib/cobbler/kickstarts/xxx.cfg
来源:https://www.cnblogs.com/chaoyiyang/p/12076117.html