cobbler部署以及使用

时间:2021-09-30 13:41:48

常用软件安装及使用目录

资源链接:https://pan.baidu.com/s/1yfVnuSgY5vOTh-B74tpVyw   网盘分享的文件在此

cobbler部署以及使用

cobbler第一次操作history。

  echo "192.168.19.200 mirrors.aliyun.com" >>/etc/hosts
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install pykickstart
ksvalidator anaconda-ks.cfg
yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
systemctl start cobblerd.service
systemctl start httpd.service
cobbler check
openssl passwd - -salt 'random-phrase-here' ''
cp /etc/cobbler/settings{,.ori}
sed -i 's/server: 127.0.0.1/server: 172.16.1.202/' /etc/cobbler/settings
sed -i 's/next_server: 127.0.0.1/next_server: 172.16.1.202/' /etc/cobbler/settings
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'oldboy' '123456'`\"#" /etc/cobbler/settings
sed -i 's#yes#no#' /etc/xinetd.d/tftp
systemctl start rsyncd
systemctl enable rsyncd
systemctl enable tftp.socket
systemctl start tftp.socket
systemctl restart cobblerd.service
cobbler check
rz -E
ls
tar xfP cobbler_load_for_CentOS7.tar_\(\).gz
cobbler check
ps -ef|grep cobb
systemctl start cobblerd.service
systemctl start httpd.service
history
history >a.txt

1.

cobbler部署以及使用

echo "192.168.19.200 mirrors.aliyun.com" >>/etc/hosts
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum install pykickstart ksvalidator anaconda-ks.cfg

加密拓展:

cobbler部署以及使用

yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
systemctl start cobblerd.service
systemctl start httpd.service
cobbler check

别人遇到的问题:

cobbler部署以及使用

应该是这样:

cobbler部署以及使用

cp /etc/cobbler/settings{,.ori}
sed -i 's/server: 127.0.0.1/server: 172.16.1.202/' /etc/cobbler/settings
sed -i 's/next_server: 127.0.0.1/next_server: 172.16.1.202/' /etc/cobbler/settings
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'oldboy' '123456'`\"#" /etc/cobbler/settings
sed -i 's#yes#no#' /etc/xinetd.d/tftp
systemctl start rsyncd
systemctl enable rsyncd
systemctl enable tftp.socket
systemctl start tftp.socket
systemctl restart cobblerd.service

cobbler部署以及使用

tar xfP cobbler_load_for_CentOS7.tar.gz
cobbler check

cobbler部署以及使用

cobbler部署以及使用

因为我是新开的测试机,所以ip与之前所用不同,所以我将ip修改为202结尾的

cobbler部署以及使用

cobbler部署以及使用

sed -n "/168/p" /etc/sysconfig/network-scripts/ifcfg-eth[]

sed -i "s#168#202#g" /etc/sysconfig/network-scripts/ifcfg-eth[]
sed -n "/202/p" /etc/sysconfig/network-scripts/ifcfg-eth[]
systemctl restart network
cobbler check

cobbler部署以及使用

下面是一个错误,没排出来,重装的

cobbler部署以及使用

sed -i.ori 's#192.168.1#172.16.1#g;22d;23d' /etc/cobbler/dhcp.template
cobbler sync

可以登陆了,HTTP不可以登录,葛一恒的广告拦截软件拦截了也没出网页。

https://10.0.0.202/cobbler_web

账号密码默认均为cobbler

连接进入了:

cobbler部署以及使用

给cobbler挂上镜像

cobbler部署以及使用

mount /dev/cdrom /mnt/

生成目录  cobbler部署以及使用

cobbler部署以及使用

ls /var/www/cobbler/ks_mirror/CentOS7.-x86_64/

cobbler部署以及使用

df -h

cobbler部署以及使用

cobbler部署以及使用

http://10.0.0.202/cblr/links/CentOS7.4-x86_64/

cobbler部署以及使用

编辑:CentOS-7-x86_64.cfg

cobbler部署以及使用

# Cobbler for Kickstart Configurator for CentOS  by Ma changwei
install
url --url=$tree
text
lang en_US.UTF-
keyboard us
zerombr
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
#Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=eth0 --onboot=yes --noipv6 --hostname=CentOS7
timezone --utc Asia/Shanghai
authconfig --enableshadow --passalgo=sha512
rootpw --iscrypted $default_password_crypted
clearpart --all --initlabel
part /boot --fstype xfs --size
part swap --size
part / --fstype xfs --size --grow
firstboot --disable
selinux --disabled
firewall --disabled
logging --level=info
reboot %pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end %packages
@^minimal
@compat-libraries
@core
@debugging
@development
bash-completion
chrony
dos2unix
kexec-tools
lrzsz
nmap
sysstat
telnet
tree
vim
wget
%end %post
systemctl disable postfix.service
%end
net.ifnames= biosdevname=

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

错误:

cobbler部署以及使用

cobbler部署以及使用

包组的配置文件出错或mac地址,ip地址等写错了

cobbler部署以及使用

cobbler部署以及使用

cobbler部署以及使用

ip配错了

cobbler部署以及使用

内存给小了,需要2G

cobbler部署以及使用