内容简介:Cobbler是一款自动化操作系统部署的实现工具,由Python语言开发,是对PXE的二次封装。融合多种特性,提供了CLI和Web的管理形式。同时,Cobbler也提供了API接口,方便二次开发使用。它不仅可以安装物理机,同时也支持kvm、xen虚拟化、Guest OS的安装。另外,它还能结合Puppet等集中化管理软件,实现自动化管理。
简介
Cobbler是一款自动化操作系统部署的实现工具,由 Python 语言开发,是对PXE的二次封装。融合多种特性,提供了CLI和Web的管理形式。同时,Cobbler也提供了API接口,方便二次开发使用。它不仅可以安装物理机,同时也支持kvm、xen虚拟化、Guest OS的安装。另外,它还能结合Puppet等集中化管理软件,实现自动化管理。
实验环境
- 系统环境:centos7.4
- Cobbler服务器端:192.168.40.89
- epel源: 百度云下载 密码:vfq2
搭建步骤:
一、安装Cobbler环境
1、测试连接外网
[root@localhost ~]# ping -c 4 www.baidu.com
2、导入并安装epel源
[root@localhost ~]#rpm -ivh epel-release-latest-7.noarch.rpm #Cobbler相关软件包是由epel源提供 [root@localhost ~]# yum list #自动加载yum更新源 [root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ls
3、安装Cobbler以及其相关服务软件包
[root@localhost ~]# yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd
cobbler:cobbler主包
cobbler-web:cobbler支持web服务包(图形化界面)
tftp-server:tftp简单文件传输包
pykickstart:无人值守安装模板,即应答文件
httpd: 通过wbe服务检测管理cobbler
rsync: 远程同步管理、同步dhcp
xinetd:管理rsync、tftp-server服务
4、启动相关服务
[root@localhost ~]# systemctl start cobblerd.service [root@localhost ~]# systemctl start httpd.service
5、检测配置文件
[root@localhost ~]# setenforce 0 #临时关闭selinux [root@localhost ~]# cobbler check
二、配置Cobbler服务
1、永久关闭防火墙、selinux
[root@localhost ~]# vim /etc/sysconfig/selinux
[root@localhost ~]# systemctl stop firewalld.service [root@localhost ~]# systemctl disable firewalld.service #开机关闭防火墙 [root@localhost ~]# reboot #重新启动
2、修改主配置文件
[root@localhost ~]# cd /etc/cobbler/ [root@localhost cobbler]# vim settings
server: 192.168.40.120 #指向cobbler服务器
next_server: 192.168.40.120 #指向tftp服务器(PXE位置)
manage_dhcp: 1 # "1"代表开启dhcp管理功能
3、编辑TFTP服务配置
[root@localhost ~]# vim /etc/xinetd.d/tftp #tftp是交由xinetd管理,xinetd目录下有对应的和安装的软件包相同的文件
4、初始化Cobbler管理员用户初始密码
[root@localhost ~]# openssl passwd -1 -salt '123' '123' #使用盐值加密 $1$123$nE5gIYTYiF1PIXVOFjQaW/ #对应的'123'的加密密文
[root@localhost ~]# vim /etc/cobbler/settings
5、下载引导系统操作文件
[root@localhost ~]# cobbler get-loaders
6、启动xinetd及rsyncd同步服务
[root@localhost ~]# systemctl restart xinetd.service [root@localhost ~]# systemctl start rsyncd.service [root@localhost ~]# systemctl enable rsyncd.service #设置开机自启动
7、修改cobbler定义的dhcp的模板
[root@localhost ~]# cd /etc/cobbler/ [root@localhost cobbler]# vim dhcp.template #编辑dhcp模板文件
8、sync服务同步生成DHCP配置文件
[root@localhost ~]# cobbler sync #同步生成DHCP配置文件 [root@localhost ~]# cd /etc/dhcp/ [root@localhost dhcp]# vim dhcpd.conf #查看DHCP配置文件
9、导入ISO镜像文件
[root@localhost ~]# mount /dev/sr0 /mnt/sr0/ [root@localhost ~]# cobbler import --path=/mnt/sr0 --name=CentOS-7-x86_64 --arch=x86_64 #导入需要点时间
cobbler import:通过Cobbler的import命令从IOS安装镜像中导入安装所需要的程序包
path:镜像(光盘)挂载的目录
name:安装源的定义的名字
arch:表示指定的安装源是32位还是64位、ia64
[root@localhost ~]# cd /var/www/cobbler/ks_mirror/
[root@localhost ks_mirror]# ls
[root@localhost ~]# yum -y install tree [root@localhost ~]# tree /var/lib/tftpboot/images
10、重启相关服务
[root@localhost ~]# systemctl restart cobblerd.service [root@localhost ~]# systemctl restart dhcpd.service [root@localhost ~]# systemctl restart xinetd.service [root@localhost ~]# systemctl restart httpd.service
三、验证Cobbler、为客户端安装系统
1、新建虚拟机
2、自动安装系统
3、安装成功
四、Cobbler的Web管理
1、使用authn_configfile模块认证方式
[root@localhost ~]# htdigest -c /etc/cobbler/users.digest Cobbler admin #创建的用户写入users.digest文件中
htdigest:Apache的Web服务器内置工具,用于创建和更新储存用户名、域和用于摘要认证的密码文件
-c:创建密码文件
Cobbler admin:创建Cobbler对象的用户名为admin
[root@localhost ~]# vim /etc/cobbler/modules.conf
2、使用authn_configfile模块认证方式
[root@localhost ~]# vim /etc/cobbler/modules.conf
[root@localhost ~]# useradd testWeb #添加测试用户 [root@localhost ~]# passwd testWeb [root@localhost ~]# vim /etc/cobbler/users.conf
[root@localhost ~]# systemctl restart httpd.service [root@localhost ~]# systemctl restart cobblerd.service
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- NFV+SDN云网联动实现VNF全自动化部署
- 月光宝盒助力全自动高覆盖回归测试
- 视频演讲: 基于 Docker 的全自动化性能测试平台
- emsite 全自动分布式开源框架发布 2.0.0 版本
- ReconCobra:一款针对信息收集的全自动化渗透测试框架
- iOS 持续集成方案,傻瓜式一键全自动化打包、上传!告别 fastlane 、Jenkins
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Domain-Driven Design
Eric Evans / Addison-Wesley Professional / 2003-8-30 / USD 74.99
"Eric Evans has written a fantastic book on how you can make the design of your software match your mental model of the problem domain you are addressing. "His book is very compatible with XP. It is n......一起来看看 《Domain-Driven Design》 这本书的介绍吧!