安装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. Toolbar的使用.md

    1.什么是Toolbar Toolbar是在Android5.0时出现的一个新控件,其目的用于取代Actionbar,它与Actionbar最大的差别就是Toolbar使用更加灵活.自由,而且Tool ...

  2. java性能监控工具jps-windows

    jps Lists the instrumented Java Virtual Machines (JVMs) on the target system. This command is experi ...

  3. poj 1651 Multiplication Puzzle【区间DP】

    题目链接:http://poj.org/problem? id=1651 题意:初使ans=0,每次消去一个值,位置在pos(pos!=1 && pos !=n) 同一时候ans+=a ...

  4. openCV—Python(1)——初始化环境

    本系列博客主要參考自--Adrian Rosebrock:<Practical Python and OpenCV: An Introductory,Example Driven Guide t ...

  5. GB28181对接视频流

    今天抽空写下以GB28181的方式获取摄像机视频流以备后用,同时也希望能帮助到正着手开发GB28181对接视频的同学,这块的资料实在不多. 今天讲的内容不涉及到平台对接,平台对接下次有时间再讲,平台对 ...

  6. 前端UI框架整理

    JQuery Jquery官网:http://jquery.com/ jQuery是一个快速,小巧,且功能丰富的JavaScript库. Jquery-1.11.3.min.js 压缩版:http:/ ...

  7. EasyPusher实现Android手机屏幕桌面直播,实时推送操作画面,用于手游直播等应用

    本文转自EasyDarwin开源团队成员John的博客:http://blog.csdn.net/jyt0551/article/details/52651194 由于Android 5.0提供了捕获 ...

  8. Java基础知识查漏 一

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

  9. webstrom编辑react语法报错解决

    问题: 解决办法:1.把 JavaScript 的版本设置为 JSX Harmony. 2.把<script>type类型改为:text/jsx

  10. 九度OJ 1128:求平均年龄 (基础题)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2080 解决:1084 题目描述: 班上有学生若干名,给出每名学生的年龄(整数),求班上所有学生的平均年龄,保留到小数点后两位. 输入: 第 ...