设为首页 收藏本站
查看: 236|回复: 0

[经验分享] cobbler安装centos 7系统

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-12-1 08:50:01 | 显示全部楼层 |阅读模式
首先需要挂载光盘:CentOS-7-x86_64-DVD-1503-01
[iyunv@linux-node1 ~]# mount /dev/cdrom /mnt
[iyunv@linux-node1 ~]# yum install cobbler cobbler-web dhcp tftp-server pykickstart  httpd -y
[iyunv@linux-node1 ~]# /etc/init.d/httpd restart
[iyunv@linux-node1 ~]# /etc/init.d/cobblerd start
[iyunv@linux-node1 ~]# cobbler check  
The following are potential configuration items that you may want to fix:
..............
Restart cobblerd and then run 'cobbler sync' to apply changes.
[iyunv@linux-node1 ~]# vim /etc/cobbler/settings
server: 10.0.0.7
next_server: 10.0.0.7
manage_dhcp: 1

[iyunv@linux-node1 ~]# cobbler get-loaders
[iyunv@linux-node1 ~]# vim /etc/xinetd.d/rsync
change 'disable' to 'no'
[iyunv@linux-node1 ~]# /etc/init.d/xinetd restart
[iyunv@linux-node1 ~]# openssl passwd -1 -salt 'oldboy' 'oldboy'
[iyunv@linux-node1 ~]# vim /etc/cobbler/settings
default_password_crypted: "$1$oldboy$fXF8f078vI9J/q9XyXA8e/"
[iyunv@linux-node1 ~]# yum install -y debmirror yum-utils fence-agents

[iyunv@linux-node1 ~]# /etc/init.d/cobblerd restart
[iyunv@linux-node1 ~]# cobbler check
[iyunv@linux-node1 ~]# vim /etc/cobbler/dhcp.template
subnet 10.0.0.0 netmask 255.255.255.0 {
     option routers             10.0.0.2;
     option domain-name-servers 10.0.0.2;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.0.0.100 10.0.0.200;

[iyunv@linux-node1 ~]# cobbler sync
[iyunv@linux-node1 ~]# cobbler import --path=/mnt/ --name=CentOS-7.1-x86_64 --arch=x86_64 /var/www/cobbler/ks_mirror/
[iyunv@linux-node1 ~]# cd /var/lib/cobbler/kickstarts/
上传ks文件至此目录:
[iyunv@linux-node2 kickstarts]# cat Cobbler-CentOS-7.1-x86_64.cfg
#Kickstart Configurator by Jason Zhao
#platform=x86, AMD64, or Intel EM64T
#System  language
lang en_US
#System keyboard
keyboard us
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $default_password_crypted
#rootpw --iscrypted $1$ops-node$7hqdpgEmIE7Z0RbtQkxW20
#Use text mode install
text
#Install OS instead of upgrade
install
#Use NFS installation Media
url --url=$tree
#url --url=http://192.168.56.11/CentOS-7.1-x86_64
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype xfs --size 1024 --ondisk sda
part swap --size 16384 --ondisk sda
part / --fstype xfs --size 1 --grow --ondisk sda
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Firewall configuration
firewall --disabled
#SELinux configuration
selinux --disabled
#Do not configure XWindows
skipx

%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end

#Package install information
%packages
@ base
@ core
sysstat
iptraf
ntp
lrzsz
ncurses-devel
openssl-devel
zlib-devel
OpenIPMI-tools
mysql
nmap
screen
%end

%post
systemctl disable postfix.service
%end
[iyunv@linux-node1 kickstarts]# mv Cobbler-CentOS-7.1-x86_64.cfg CentOS-7.1-x86_64.cfg
[iyunv@linux-node1 kickstarts]# cobbler profile edit --name=CentOS-7.1-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7.1-x86_64.cfg
[iyunv@linux-node1 kickstarts]# cobbler profile edit --name=CentOS-7.1-x86_64 --kopts='net.ifnames=0 biosdevname=0'
然后打开一台新的虚拟机,让它自动获取即可

root             oldboy


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-145647-1-1.html 上篇帖子: CentOS 6.5 VNC 安装 下篇帖子: LINUX VIM编译器常用命令总结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表