linux使用cobbler安装ubuntu系统:

介绍和建议:

    介绍:
Cobbler是Linux安装服务器,可用于快速设置网络安装环境。它可以粘合在一起并自动执行许多相关的Linux任务,因此在部署新系统以及在某些情况下更改现有系统时,您不必在许多不同的命令和应用程序之间切换。Cobbler可以帮助您配置,管理DNS和DHCP,程序包更新,电源管理,配置管理流程等。
    建议:
可以使用centos7 来安装服务并进行安装系统,经常安装的系统有

  • ubuntu
  • centos/Red hat
  • pve
  • Debian

安装的时候尽可能保证环境一样,不然容易出现各种小问题,这种问题可能导致你浪费时间,你可以自己有时间进行研究
    环境和安装服务:

    环境:
             centos7.4
    安装服务:

  • dhcp:负责分配网络
  • xinetd:tftp负责两台电脑上传读取文件
  • cobbler:压缩合适的文件并调整网络服务,以正确引导机器
  • cobbler-web:安装之后可以页面登陆

搭建环境:

#关闭防火墙:   
systemctl stop firewalld

#关闭selinux为disable状态:
vim /etc/selinux/config
	SELINUX=disabled

#下载阿里云epel源
yum  intall -y wget #如果已经安装 则不需要重复安装
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

#下载安装服务包
yum install -y dhcp tftp-server xinetd httpd cobbler cobbler-web pykickstart debmirror

#设置服务为开机自启动:
systemctl start httpd
systemctl enable httpd
systemctl start cobblerd
systemctl enable cobblerd
systemctl start rsyncd
systemctl enable rsyncd
systemctl start xinetd
systemctl enable xinetd

#检测cobbler
cobbler check

The following are potential configuration items that you may want to fix:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
    https://github.com/cobbler/cobbler/wiki/Selinux
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp
5 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

#备份配置文件
cp /etc/cobbler/settings{,.bak} 
#修改配置文件:/etc/cobbler/settings
sed -i "s#server: 127.0.0.1#server: 本机IP#" /etc/cobbler/settings
sed -i "s#next_server: 127.0.0.1#next_server: 本机IP#" /etc/cobbler/settings
sed -i "s#pxe_just_once: 0#pxe_just_once: 1#" /etc/cobbler/settings
sed -i "s#manage_dhcp: 0#manage_dhcp: 1#" /etc/cobbler/settings
#设置开机密码
openssl passwd -1 -salt 'root' '111.'
$1$root$W4Jdd/gf2mT7AAHxo2EEx0

vim /etc/cobbler/settings
default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." 修改为
default_password_crypted: "$1$root$W4Jdd/gf2mT7AAHxo2EEx0"

sed -i "/disable/ {s#yes#no#}" /etc/xinetd.d/tftp
#最后执行以下在官网下载最新的
cobbler get-loaders
sed -i  's|@dists=.*|#@dists=|'  /etc/debmirror.conf 
sed -i  's|@arches=.*|#@arches=|'  /etc/debmirror.conf

设置DHCP

#备份配置文件:
 cp /etc/cobbler/dhcp.template{,.bak}

修改配置DHCP文件
vim /etc/cobbler/dhcp.template
配置文件讲解:
subnet:自己IP地址
option routers:网关地址
option domain-name-server:网关地址
range dynamic-bootp:dhcp分配地址范围
next-server:会按照配置文件自动修改为自己的IP地址:(不需要修改)
在这里插入图片描述
重启服务:

systemctl restart cobblerd

同步服务状态:

cobbler sync

查看dhcp配置文件:

cat /etc/dhcp/dhcpd.conf 

下载ubuntu镜像:官网最新版本的18.04.4是眉有netboot文件

http://cdimage.ubuntu.com/releases/18.04.4/release/  #这个也是官网的   不过是传统版本的方式
把镜像文件下载到/home目录
mkdir /root/IOS

挂载镜像
mount /home/ubuntu-18.04.ios /root/IOS
cobbler import --path=/root/IOS --name=ubuntu-18.04 --arch=x86_64

使用web方式查看是否导入成功
https://192.168.119.133/cobbler-web

ubuntu的seed文件

centos的ks文件

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值