安装Cobbler

 [root@linux-node3 ~]# yum -y install epel-release
[root@linux-node3 ~]# yum -y install cobbler cobbler-web dhcp httpd xinetd pykickstart fence-agents # 如果你的报错请用163源
[root@linux-node3 ~]# chkconfig cobblerd on
[root@linux-node3 ~]# chkconfig httpd on
[root@linux-node3 ~]# chkconfig dhcpd on
[root@linux-node3 ~]# chkconfig xinetd on
[root@linux-node3 ~]# chkconfig rsyncd on
[root@linux-node3 ~]# sed -i -e 's/\=\ yes/\=\ no/g' /etc/xinetd.d/tftp
[root@linux-node3 ~]# openssl passwd - -salt "cobbler" "centos" # centos为你之后所装所有机器的root密码,cobbler是对centos进行加密时用到的加密文(可以去看下salt加密相关),参数是数字1不是字母l
[root@linux-node3 ~]# cat/etc/cobbler/settings
next_server: 192.168.145.11 # 提供pxe的主机,你的本机ip
server: 192.168.145.11 # 提供cobbler的主机,还是你的本机ip
manage_dhcp:
manage_rsync:
default_password_crypted: "$1$cobbler$DWL2fHTHaRTa2hj5VEuZk." # 刚才使用加密后得到的密文,注意最后有个.
pxe_just_once: # 防止循环装系统,很重要! [root@linux-node3 ~]# cat /etc/cobbler/dhcp.template # 更改第一段就好,其实就是dhcp的配置
subnet 192.168.56.0 netmask 255.255.255.0 {
option routers 192.168.56.2;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.56.100 192.168.56.254;
default-lease-time ;
max-lease-time ;
next-server $next_server;
class "pxeclients" {
match if substring (option vendor-class-identifier, , ) = "PXEClient";
if option pxe-system-type = : {
filename "ia64/elilo.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86_64.efi";
} else if option pxe-system-type = : {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
} } [root@linux-node3 ~]# systemctl start xinetd
[root@linux-node3 ~]# systemctl start dhcpd
[root@linux-node3 ~]# systemctl start httpd
[root@linux-node3 ~]# systemctl start rsyncd
[root@linux-node3 ~]# systemctl start cobblerd
[root@linux-node3 ~]# cobbler get-loaders # 去git下载cobbler相关包,下载慢的话可以把dns换成114.114.114.
[root@linux-node3 ~]# cobbler sync # 每次有修改过文件后都要执行哦
[root@linux-node3 ~]# cobbler check # cobbler自带的检测命令,出了问题就可以使用下,可以快速帮助你检测出问题的所在点,centos7会出debmirror错误,这是安装debian系统相关的,不会影响到使用
[root@linux-node3 ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler # 设置cobbler_web页面的访问密码
访问https://192.168.145.11/cobbler_web # 用户名为cobbler,密码刚才设置的,注意是https [root@linux-node3 ~]# cat /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT
MENU TITLE Cobbler | http://www.cnblogs.com/bfmq/
TIMEOUT # 装系统时的等待时间,默认20秒
TOTALTIMEOUT
ONTIMEOUT centos7.-x86_64 # 这个需要改成你自己的cobbler profile list出现的,之后默认不选择系统引导后就会自动选择这个 LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -
$pxe_menu_items MENU end

使用Cobbler

 [root@linux-node3 ~]# mount /dev/sr0 /mnt                # /dev/sr0是centos7.2的iso源镜像
[root@linux-node3 ~]# cobbler import --path=/mnt/ --name=centos7. # 需要一些时间,导入的镜像会放在/var/www/cobbler/ks_mirror内,以name指定的为目录名
[root@linux-node3 ~]# cd /var/lib/cobbler/kickstarts [root@linux-node3 ~]# cat centos7.-x86_64.cfg # 里面不可以有中文,so,不注释含义了,都很好理解
# kickstart template for Fedora and later.
# (includes %end blocks)
# do not use with earlier distros #platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot #Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart
#clearpart --all --initlabel
#part / --fstype xfs --size 1 --grow --asprimary --onbiosdisk=80 #part swap --maxsize= --asprimary --size= --onbiosdisk=80 #part /boot --fstype=xfs --grow --asprimary --size= --onbiosdisk=80 %packages
@^minimal
@base
@core
@development lftp
openssh-clients
tree
lrzsz
telnet
nc
sysstat
gcc
gcc-c++
%end %post
sed -i "s/#UseDNS yes/UseDNS no/g" /etc/ssh/sshd_config
echo 'export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "' >> /etc/bashrc
echo 'export HISTSIZE=9999' >> /etc/bashrc
IP=`ifconfig eth0|grep netmask|awk '{print $2}'`
HN=`echo $IP|awk -F. '{print $NF}'`
sed -i 's/dhcp/none/g' /etc/sysconfig/network-scripts/ifcfg-eth0
echo 'PREFIX=24' >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "IPADDR=$IP" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo 'GATEWAY=192.168.145.2' >> /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i 's/nameserver *.*.*.*/nameserver 8.8.8.8/g' /etc/resolv.conf
systemctl restart network
%end %pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end [root@linux-node3 ~]# cobbler profile edit --name=centos7.-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.-x86_64.cfg
[root@linux-node3 ~]# cobbler profile edit --name= centos7.-x86_64 --kopts='net.ifnames=0 biosdevname=0' # 装6的系统不需要,这是统一网卡名称用的 96 [root@linux-node3 ~]# cobbler sync

然后你就可以直接开机等待系统自动安装了

Cobbler安装配置简单使用的更多相关文章

  1. Linux装机利器Cobbler安装配置

     Linux装机利器Cobbler安装配置 2011-05-27 15:31:05 分类: LINUX 一.安装环境 centos 5.4 关掉iptables 关掉 selinux selinux ...

  2. saltstack master minion安装配置简单使用

    首先先了解下saltstack是什么,为什么使用它 它与Ansible.Puppet都属于集中管理工具,由于现在企业规模的不断庞大及业务的增长,所需要管理的服务器数量增多,而且大部分机器都属于同类业务 ...

  3. cobbler安装配置(二)

    安装环境: 操作系统:CentOS 6.5 x86_64测试机器ip:192.168.0.1 关闭防火墙.selinux:service iptables stop && chkcon ...

  4. puppet yum安装配置,简单证书维护

    Puppet学习之puppet的安装和配置 一.Puppet简介 Puppet基于ruby语言开发的自动化系统配置工具,可以C/S模式或独立运行,支持对所有UNIX及类UNIX系统的配置管理,最新版本 ...

  5. cobbler安装配置.基本全了多看help和docs

    env 系统环境配置,软件包安装 centos7 yum update -y sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/ ...

  6. Jenkins安装配置简单使用

    安装启动是十分简单的,直接去https://jenkins.io/download/下载对应的rpm包就好了,需要注意的是我们的机器上要提前有java环境,相对应要选择你java环境可以支持的jenk ...

  7. ELK安装配置简单使用

    ELK是三款软件的总称,包括了elasticsearch.logstash.kibana,其实在生产使用中,我们还需要使用到其他的更多辅助软件来更好更合理的收集展示数据. Elasticsearch: ...

  8. Katalon Studio 安装 配置 简单使用

    本教程只针对Katalon Studio进行演示操作. 一.下载 Katalon 官网下载地址:https://www.katalon.com/download/ (需要注册账号) 二.解压.配置 直 ...

  9. glusterfs安装配置简单使用

    GlusterFS是一种分布式分布式文件系统,默认采用无中心完全对等架构,搭建维护使用十分简单,是很受欢迎的分布式文件系统. 官网https://www.gluster.org/,官网上表示Glust ...

随机推荐

  1. 【bzoi2006】【狼抓兔子】【最小割】

    Description Source: Beijing2006 [BJOI2006] 八中OJ上本题链接:http://www.lydsy.com/JudgeOnline/problem.php?id ...

  2. python(5)- 简单练习:python三级菜单优化

    python三级菜单优化,菜鸟版链接:http://www.cnblogs.com/xuyaping/p/6648170.html menu = { '北京':{ '海淀':{ '五道口':{ 'so ...

  3. hdu5387(2015多校8)--Clock(模拟)

    题目链接:点击打开链接 题目大意:给出一个时间,问在钟表上这个时间的时候.时针和分针的角度,时针和秒针的角度.分针和秒针的角度.假设不是整数以分数的形式输出. 假设依照最小的格来算,那么: 1s对于秒 ...

  4. git操作-如何把你的本地仓库放到GitHub已有仓库

    本地: 首先在你的本地git init 初始化一个仓库,然后git add . 将所有的文件都打包到仓库中,git -commit -m "first_commit" 此时是没有什 ...

  5. H5 手机横竖屏判读

    $.fn.screenCheck = function() { var pDiv = $('<div></div>'); pDiv.addClass("screenC ...

  6. Spring的常见问题及答案

    目录 Spring 概述 依赖注入 Spring beans Spring注解 Spring数据访问 Spring面向切面编程(AOP) Spring MVC Spring 概述 1. 什么是spri ...

  7. 2014年辛星解读css第五节

    本小节我们解说css中的"盒模型".即"box model",它通经常使用于在布局的时候使用,这个"盒模型"也有人成为"框模型&q ...

  8. Java基础知识查漏 一

    Java基础知识查漏 一 Jdk和jre Jdk是java程序设计师的开发工具,只要包含编译程序,jvm和java函数库 Jre中只有jvm和java函数库,没有编译程序的相关工具,适合只运行不撰写j ...

  9. 九度OJ 1095:2的幂次方 (递归)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:913 解决:626 题目描述: Every positive number can be presented by the exponent ...

  10. mac下使用gnu gcc

    1 mac下安装gnu gcc brew search gcc brew install gcc@6 2 mac下编写c/c++代码所需的标准库和头文件 2.1 标准c++的库的头文件都是标准化了的, ...