#!/bin/bash
#配置yum源
curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS7-Base-163.repo
sed -i 's/^enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS7-Base-163.repo
yum -y install epel-release
#安装cobbler以及相关软件
yum install -y httpd dhcp tftp python-ctypes cobbler xinetd cobbler-web pykickstart
#启动服务并设置开机自启
systemctl start httpd
systemctl start cobblerd
systemctl enable httpd
syatemctl enable cobblerd
#关闭防火墙
firewall()
{
systemctl stop firewalld
systemctl disable firewalld
systemctl mask firewalld
setenforce 0
}
#获取本机IP地址
ip=`ifconfig ens33
cobbler服务端脚本部署
最新推荐文章于 2022-10-21 17:05:03 发布