码迷,mamicode.com
首页 > 其他好文 > 详细

cobbler部署以及使用

时间:2019-02-23 18:18:40      阅读:324      评论:0      收藏:0      [点我收藏+]

标签:post   map   col   obb   div   rsync   sts   arp   ssl   

 

 常用软件安装及使用目录

 

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

技术图片

cobbler第一次操作history

 

1  echo "192.168.19.200 mirrors.aliyun.com" >>/etc/hosts
    2  curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    3  curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    4  yum install pykickstart
    5  ksvalidator anaconda-ks.cfg
    6  yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
    7  systemctl start cobblerd.service 
    8  systemctl start httpd.service 
    9  cobbler check
   10  openssl passwd -1 -salt random-phrase-here 123456
   11  cp /etc/cobbler/settings{,.ori}
   12  sed -i s/server: 127.0.0.1/server: 172.16.1.202/ /etc/cobbler/settings
   13  sed -i s/next_server: 127.0.0.1/next_server: 172.16.1.202/ /etc/cobbler/settings
   14  sed -i s/manage_dhcp: 0/manage_dhcp: 1/ /etc/cobbler/settings
   15  sed -i s/pxe_just_once: 0/pxe_just_once: 1/ /etc/cobbler/settings
   16  sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt ‘oldboy‘ ‘123456‘`\"#" /etc/cobbler/settings
   17  sed -i s#yes#no# /etc/xinetd.d/tftp
   18  systemctl start rsyncd
   19  systemctl enable rsyncd
   20  systemctl enable tftp.socket
   21  systemctl start tftp.socket 
   22  systemctl restart cobblerd.service
   23  cobbler check
   24  rz -E
   25  ls
   26  tar xfP cobbler_load_for_CentOS7.tar_\(1\).gz 
   27  cobbler check
   28  ps -ef|grep cobb
   29  systemctl start cobblerd.service
   30  systemctl start httpd.service
   31  history
   32  history >a.txt

 

1.

技术图片

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

别人遇到的问题:

技术图片

应该是这样:

技术图片

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

技术图片

tar xfP cobbler_load_for_CentOS7.tar.gz 
cobbler check

技术图片

技术图片

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

技术图片

技术图片

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

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

 

cobbler check

技术图片

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

技术图片

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挂上镜像

技术图片

mount /dev/cdrom /mnt/

生成目录  技术图片

技术图片

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

技术图片

df -h

技术图片

 技术图片

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

技术图片

编辑:CentOS-7-x86_64.cfg

技术图片

# Cobbler for Kickstart Configurator for CentOS 7 by Ma changwei
install
url --url=$tree
text
lang en_US.UTF-8
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 1024
part swap --size 1024
part / --fstype xfs --size 1 --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=0 biosdevname=0

技术图片

技术图片

技术图片

技术图片

技术图片

技术图片

技术图片

技术图片

技术图片

技术图片

错误:

技术图片

技术图片

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

技术图片

技术图片

技术图片

ip配错了

技术图片

内存给小了,需要2G

技术图片

 

cobbler部署以及使用

标签:post   map   col   obb   div   rsync   sts   arp   ssl   

原文地址:https://www.cnblogs.com/machangwei-8/p/10423605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!