标签:salt eth 管理系 9.png 自启 span server src key
系统:CentOS 7.4
ip: 外网:10.0.0.202 内网:172.16.1.202
yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd
#备份、修改cobbler配置文件
cp /etc/cobbler/settings{,.bak}
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 ‘xzy‘ ‘123456‘`\"#" /etc/cobbler/settings
#即:default_password_crypted: "$1$oldboy$Npg9Pt9k98Mlg0ZeqHAuN1"
# openssl passwd -1 -salt ‘xzy‘ ‘123456‘ (以xzy为填充字符)
sed -i ‘s#yes#no#‘ /etc/xinetd.d/tftp
systemctl start rsyncd tftp.socket
#开机自启 enable
systemctl enable rsyncd tftp.socket
systemctl restart httpd
systemctl restart cobblerd.service
#修改dhcp 配置文件
sed -i.ori ‘s#192.168.1#172.16.1#g;22d;23d‘ /etc/cobbler/dhcp.template
#将cobbler/dhcp.template同步到dhcp配置文件
cobbler sync
#检查 cobbler check
错误1 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run ‘cobbler get-loaders‘ to download them
#解决方法:
#网上下载
cobbler get-loaders
#拷贝一份
tar xfP cobbler_load_for_CentOS7.tar.gz
#接下来即可web界面操作
网址:https://10.0.0.202/cobbler_web/
用户名:cobbler 密码:cobbler
前提:选择镜像并挂载
mount /dev/cdrom /mnt/
具体内容见最后:
#创建系统systems
#配置操作
#web 操作大致步骤1234(顺序不需一样)
web界面添加多个“system”(利用mac地址识别)
#CentOS7的ks文件 CentOS-7-x86_64.cfg
# Cobbler for Kickstart Configurator for CentOS 7 by yao zhang
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
# Cobbler for Kickstart Configurator for CentOS 6.8 by yao zhang
install
url --url=$tree
text
lang en_US.UTF-8
keyboard us
zerombr
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
$SNIPPET(‘network_config‘)
timezone --utc Asia/Shanghai
authconfig --enableshadow --passalgo=sha512
rootpw --iscrypted $default_password_crypted
clearpart --all --initlabel
part /boot --fstype=ext4 --asprimary --size=200
part swap --size=1024
part / --fstype=ext4 --grow --asprimary --size=200
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
@base
@compat-libraries
@debugging
@development
tree
nmap
sysstat
lrzsz
dos2unix
telnet
%end
%post --nochroot
$SNIPPET(‘log_ks_post_nochroot‘)
%end
%post
$SNIPPET(‘log_ks_post‘)
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET(‘post_install_kernel_options‘)
$SNIPPET(‘post_install_network_config‘)
$SNIPPET(‘func_register_if_enabled‘)
$SNIPPET(‘download_config_files‘)
$SNIPPET(‘koan_environment‘)
$SNIPPET(‘redhat_register‘)
$SNIPPET(‘cobbler_register‘)
# Enable post-install boot notification
$SNIPPET(‘post_anamon‘)
# Start final steps
$SNIPPET(‘kickstart_done‘)
# End final steps
%end
推荐相关博客:http://blog.oldboyedu.com/autoinstall-cobbler/
标签:salt eth 管理系 9.png 自启 span server src key
原文地址:http://www.cnblogs.com/xzy-blog/p/7859446.html