当前位置: 首页 > news >正文

centos7.5+cobbler2.8.4实战图文攻略--2019持续更新

2019-02-28 11:41:07
一、cobbler安装部署

1、修改YUM仓库

vim /etc/yum.repos.d/my.repo

[epel]
name=epel
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/
enabled=1
gpgcheck=0

2、安装cobbler

yum install dhcp httpd xinetd tftp cobbler cobbler-web -y

3、修改cobbler配置文件

生成加密密码:openssl passwd -1 -salt bw.com 123456

vim /etc/cobbler/settings

server: 192.168.100.100
next_server: 192.168.100.100
default_password_crypted: "$1$stu.com$Pp0HQwZhSF...mXIxjJAH." #root管理员密码

4、配置DHCP

vim /etc/dhcpd/dhcp.conf

option domain-name "stu.com";
option domain-name-servers 192.168.100.100;
default-lease-time 36000;
max-lease-time 72000;
log-facility local7;

subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.110 192.168.100.150;
option routers 192.168.100.1;
option broadcast-address 192.168.100.255;
next-server 192.168.100.100;
filename "pxelinux.0";
}

systemctl start dhcpd
systemctl enable dhcpd

5、配置tftp

vim /etc/xinetd.d/tftp

disable= no

systemctl start xinetd
systemctl enable xinetd

6、下载启动引导文件

systemctl start httpd
systemctl enable httpd

cobbler get-loaders

centos7.5+cobbler2.8.4实战图文攻略--2019持续更新

cobbler sync

7、导入光盘镜像文件

cobbler import --path=/mnt/cdrom --name=c75 --arch=x86_64
centos7.5+cobbler2.8.4实战图文攻略--2019持续更新
centos7.5+cobbler2.8.4实战图文攻略--2019持续更新

8、生成自动应答文件

vim /var/lib/cobbler/kickstarts/c75.ks

#platform=x86, AMD64, Intel EM64T
#version=DEVEL
#Install OS instead of upgrade
install
#Keyboard layouts
keyboard 'us'
#Root password
rootpw --iscrypted $default_password_crypted #见第3步
#System timezone
timezone Asia/Shanghai
#Use network installation
url --url=$tree
#System language
lang en_US.UTF-8
#Firewall configuration
firewall --disabled
#System authorization information
auth --useshadow --enablemd5
#Use graphical install
text
firstboot --disable
#SELinux configuration
selinux --disabled
#Reboot after installation
reboot
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype="xfs" --size=256
part swap --fstype="swap" --size=1024
part / --fstype="xfs" --ondisk=sda --size=1 --grow #使用全部剩余空间
#Network information
$SNIPPET('network_config')
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
#Enable installation monitoring
$SNIPPET('pre_anamon')
%end

%packagesbr/>@^minimalbr/>@compat-librariesbr/>@core
@development
bash-completion
vim
net-tools
bind-utils
tree
lrzsz
wget
telnet
-postfix
%end

%addon com_redhat_kdump --disable --reserve-mb='auto'
%end

%post
#Start yum configuration
$yum_config_stanza
#End yum configuration
%end

%post
sed -i "1s/5/0/" /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
rm -f /etc/yum.repos.d/CentOS*
yum remove NetworkManager -y
%end

二、cobbler配置

1、编辑profile
cobbler profile edit --name=c75-x86_64 --kickstart=/var/lib/cobbler/kickstarts/c75.ks
cobbler profile edit --name=c75-x86_64 --kopts='net.ifnames=0 biosdevname=0 ipv6.disable=1'

2、客户端默认local启动

vim /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 1
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile

LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1

$pxe_menu_items

MENU end

cobbler system add --name=default --profile=c75-x86_64

cobbler sync

systemctl restart dhcpd
systemctl restart xinetd
systemctl restart httpd
systemctl restart cobblerd

3、配置IP信息及主机名

cobbler system add --name=lbmaster --profile=c75-x86_64 --kickstart=/var/lib/cobbler/kickstarts/c75.ks \
--interface=eth0 --static=1 --mac=00:50:56:20:38:C8 --ip-address=192.168.100.10 --subnet=255.255.255.0 --gateway=192.168.100.1 \
--name-servers="192.168.100.100" --hostname=lbmaster.stu.com

4、配置YUM仓库

(1)同步网络YUM仓库
cobbler repo add --name=openstack --mirror=https://mirrors.aliyun.com/centos/7.5.1804/cloud/x86_64/openstack-ocata/ --arch=x86_64 --breed=yum
cobbler repo add --name=zabbix --mirror=https://mirrors.aliyun.com/zabbix/zabbix/3.5/rhel/7/x86_64/ --arch=x86_64 --breed=yum

cobbler reposync

cobbler profile edit --name=c75-x86_64 --kickstart=/var/lib/cobbler/kickstarts/c75-cobbler.ks --repos="openstack"
crontab -e
cobbler reposync --tries=3 --no-fail

(2)修改默认YUM仓库配置文件

vim /var/www/cobbler/ks_mirror/config/c75-x86_64.repo

[core-0]br/>name=core-0br/>baseurl=http://@@http_server@@/cobbler/ks_mirror/c75-x86_64
enabled=1
gpgcheck=0
priority=$yum_distro_priority

[epel]
names=epel
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/
enabled=1
gpgcheck=0

systemctl start cobblerd
systemctl enable cobblerd

cobbler sync

转载于:https://blog.51cto.com/14199566/2363306

相关文章:

  • Node.js设计模式读书笔记(2)
  • 物流行业如何选择手持终端
  • CH2906 武士风度的牛(算竞进阶习题)
  • 2014年蓝桥杯部分题目与解答
  • 重拾 ObjC 自动释放池
  • 监听JS对象属性变化 Object.defineProperty Proxy 记录
  • 读ios开发有感——建立APP开发体系
  • 回归
  • Kubernetes — 重新认识Docker容器
  • 专业术语------扫盲
  • 实验1
  • nunjucks模版引擎入门
  • git flow常用命令
  • PHP实现多维数组按指定值排序
  • 高分笔记_括号匹配
  • [译] React v16.8: 含有Hooks的版本
  • 07.Android之多媒体问题
  • 4月23日世界读书日 网络营销论坛推荐《正在爆发的营销革命》
  • CSS进阶篇--用CSS开启硬件加速来提高网站性能
  • ERLANG 网工修炼笔记 ---- UDP
  • Flannel解读
  • HTTP--网络协议分层,http历史(二)
  • jQuery(一)
  • Laravel 菜鸟晋级之路
  • Laravel深入学习6 - 应用体系结构:解耦事件处理器
  • LeetCode541. Reverse String II -- 按步长反转字符串
  • Linux后台研发超实用命令总结
  • Logstash 参考指南(目录)
  • Mithril.js 入门介绍
  • Promise面试题2实现异步串行执行
  • Shell编程
  • Swift 中的尾递归和蹦床
  • Webpack4 学习笔记 - 01:webpack的安装和简单配置
  • 高性能JavaScript阅读简记(三)
  • 关于 Cirru Editor 存储格式
  • 力扣(LeetCode)21
  • 微信如何实现自动跳转到用其他浏览器打开指定页面下载APP
  • 一些css基础学习笔记
  • 原创:新手布局福音!微信小程序使用flex的一些基础样式属性(一)
  • 自动记录MySQL慢查询快照脚本
  • 蚂蚁金服CTO程立:真正的技术革命才刚刚开始
  • #define与typedef区别
  • #LLM入门|Prompt#3.3_存储_Memory
  • (MIT博士)林达华老师-概率模型与计算机视觉”
  • (二十一)devops持续集成开发——使用jenkins的Docker Pipeline插件完成docker项目的pipeline流水线发布
  • (原創) 如何優化ThinkPad X61開機速度? (NB) (ThinkPad) (X61) (OS) (Windows)
  • .gitattributes 文件
  • .NET 回调、接口回调、 委托
  • .netcore 如何获取系统中所有session_如何把百度推广中获取的线索(基木鱼,电话,百度商桥等)同步到企业微信或者企业CRM等企业营销系统中...
  • .NET建议使用的大小写命名原则
  • .NET正则基础之——正则委托
  • ?
  • [ web基础篇 ] Burp Suite 爆破 Basic 认证密码
  • [@Controller]4 详解@ModelAttribute
  • [2018/11/18] Java数据结构(2) 简单排序 冒泡排序 选择排序 插入排序