博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cobbler安装centos 7系统
阅读量:6328 次
发布时间:2019-06-22

本文共 3497 字,大约阅读时间需要 11 分钟。

环境:CentOS 6.5

前提:关闭selinux,iptables

首先需要挂载光盘:CentOS-7-x86_64-DVD-1503-01

[root@linux-node1 ~]# mount /dev/cdrom /mnt

[root@linux-node1 ~]# yum install cobbler cobbler-web dhcp tftp-server pykickstart  httpd epel* -y

[root@linux-node1 ~]# /etc/init.d/httpd restart

[root@linux-node1 ~]# /etc/init.d/cobblerd start

[root@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.

[root@linux-node1 ~]# vim /etc/cobbler/settings

server: 10.0.0.7

next_server: 10.0.0.7

manage_dhcp: 1

[root@linux-node1 ~]# cobbler get-loaders

[root@linux-node1 ~]# vim /etc/xinetd.d/rsync

change 'disable' to 'no'

[root@linux-node1 ~]# /etc/init.d/xinetd restart

[root@linux-node1 ~]# openssl passwd -1 -salt 'oldboy' 'oldboy'

[root@linux-node1 ~]# vim /etc/cobbler/settings

default_password_crypted: "$1$oldboy$fXF8f078vI9J/q9XyXA8e/"

[root@linux-node1 ~]# yum install -y debmirror yum-utils fence-agents

[root@linux-node1 ~]# /etc/init.d/cobblerd restart

[root@linux-node1 ~]# cobbler check

[root@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;

[root@linux-node1 ~]# cobbler sync

[root@linux-node1 ~]# cobbler import --path=/mnt/ --name=CentOS-7.1-x86_64 --arch=x86_64 /var/www/cobbler/ks_mirror/

[root@linux-node1 ~]# cd /var/lib/cobbler/kickstarts/

上传ks文件至此目录:

[root@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

[root@linux-node1 kickstarts]# mv Cobbler-CentOS-7.1-x86_64.cfg CentOS-7.1-x86_64.cfg

[root@linux-node1 kickstarts]# cobbler profile edit --name=CentOS-7.1-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7.1-x86_64.cfg

[root@linux-node1 kickstarts]# cobbler profile edit --name=CentOS-7.1-x86_64 --kopts='net.ifnames=0 biosdevname=0'

然后打开一台新的虚拟机,让它自动获取即可

root             oldboy

     本文转自陈继松 51CTO博客,原文链接:http://blog.51cto.com/chenjisong/1718128,如需转载请自行联系原作者

你可能感兴趣的文章
图片时钟
查看>>
Unity-2017.3官方实例教程Space-Shooter(一)
查看>>
makefile中重载与取消隐藏规则示例
查看>>
Linux 内核版本号查看
查看>>
4-3 简单求和 (10分)
查看>>
Python环境部署
查看>>
[BZOJ1927]星际竞速(费用流)
查看>>
为运维人员插上腾飞更远的翅膀!
查看>>
备用数据库快照
查看>>
编写shell脚本计划备份mysql数据库
查看>>
单页面应用简介
查看>>
Word 2003中编辑标记与格式标记大讨论
查看>>
从国内向海外转移域名经验谈
查看>>
浅谈apache与tomact的整合
查看>>
详解XStream别名
查看>>
SQL Server vNext CTP1 on Linux
查看>>
1-为 Lync Server 2010 准备 Active Directory 域服务
查看>>
Grid Control 10G安装与配置
查看>>
SELinux安全
查看>>
NetBackup下ORACLE恢复测试方案实例解析
查看>>