env

系统环境配置,软件包安装 centos7

yum update -y
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux
# the file in some versions of the system are in /etc/selinux/config
setenforce 0
service iptables stop #or systemctl stop firewalld
hostnamectl set-hostname cobbler
echo "cobbler 192.168.10.250" >>/etc/hosts
yum install -y chrony.x86_64 && systemctl start chronyd && systemctl enable chronyd
timedatectl set-ntp 0
timedatectl set-timezone Asia/Shanghai
yum install bash-completion epel-release.noarch -y
yum makecache
reboot

service install

服务安装,启动

yum -y install httpd dhcp tftp python-ctypes cobbler  xinetd cobbler-web
systemctl start cobblerd
systemctl enable cobblerd
systemctl start httpd
systemctl enable httpd
systemctl start rsyncd
systemctl enable rsyncd
cobbler check
[root@cobbler ~]# cobbler check
The following are potential configuration items that you may want to fix: 1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : ksvalidator was not found, install pykickstart
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them Restart cobblerd and then run 'cobbler sync' to apply changes.
  • 根据提示1.2,修改serverip为内网IP
sed -i 's/^server: 127.0.0.1/server: 192.168.10.250/' /etc/cobbler/settings
sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.10.250/' /etc/cobbler/settings
  • 修改3,tftp配置
vi /etc/xinetd.d/tftp
disable = no
  • 下载4,cobbler-loaders
cobbler get-loaders
  • 安装6.8,pykickstart
yum install -y pykickstart fence-agents
  • 设置7,默认密码加密方式和默认密码加入配置文件
openssl passwd -1 -salt "abcdef" "1234567890"
$1$abcdef$MgVBnksOqk99cgXuJlRJS0
vi /etc/cobbler/settings
default_password_crypted $1$abcdef$MgVBnksOqk99cgXuJlRJS0

此时重启服务器.让修改都生效第5项是deb的包管理工具.我用的centos7所以不管

manage dhcp

  • 启用dhcp功能
cat /etc/cobbler/settings|grep manage
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
  • 修改 dhcp 配置

    vi /etc/cobbler/dhcp.template
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option domain-name-servers 192.168.10.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.10.120 192.168.10.199;
systemctl restart cobblerd.service
cobbler sync
cat /etc/dhcp/dhcpd.conf #检查dhcp配置是否正确
systemctl start dhcpd
systemctl enable dhcpd

配置安装源(distro)

mount -t auto ./iso/CentOS-7-x86_64-Minimal-1511.iso  /mnt
cobbler import --path=/mnt/ --name Centos7-x86_64 --arch=x86_64
cobbler report #查看导入信息

自定义kickstart

vi centos7.cfg

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $default_password_crypted
# Use network installation
url --url="$tree"
# System language
lang en_US
# Firewall configuration
firewall --disabled
# System authorization information
auth --useshadow --passalgo=sha512
# Use text install
text
firstboot --disable
# SELinux configuration
selinux --disabled # Network information
network --bootproto=dhcp --device=eth0
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="ext4" --size=200
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1 %pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end
%post
yum install -y telnet readline bash-completion
yum update -y
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux
# the file in some versions of the system are in /etc/selinux/config
setenforce 0
service iptables stop #or systemctl stop firewalld
hostnamectl set-hostname cobbler
echo "cobbler 192.168.10.250" >>/etc/hosts
yum install -y chrony.x86_64 && systemctl start chronyd && systemctl enable chronyd
timedatectl set-ntp 0
timedatectl set-timezone Asia/Shanghai
yum install bash-completion epel-release.noarch -y
yum makecache
%end
%packages
%end
cp centos7.cfg /var/lib/cobbler/kickstarts/
cobbler profile edit --name Centos7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7.cfg
cobbler profile edit --name Centos7-x86_64 --kopts='net.ifnames=0 biosdevname=0' #修改默认网卡名为eth0
cobbler validateks #检查ks文件配置
cobbler sync

定制装机页面

vi /etc/cobbler/pxedefault.template # or /etc/cobbler/pxe/pxedefault.template
MENU TITLE who-what-when Install System #修改title
MENU MASTER PASSWD $1$abcdef$MgVBnksOqk99cgXuJlRJS0 #pxe passwd
LABEL XXXX
MENU PASSWD #启用密码

新建虚拟机使用pxe启动

qemu-img create -f qcow2 -o size=60G /var/lib/libvirt/images/test.qcow2
virt-install --name test --ram 1024 --vcpus=2 --pxe --disk path=/var/lib/libvirt/images/ test.qcow2,bus=virtio,size=20,sparse,format=qcow2 --network bridge=br0,model=virtio --force

客户端自动重装

yum install -y epel-release
yum install -y koan
koan --server=192.168.10.250 --list=profiles
koan --replace-self --server=192.168.10.250 --profile=Centos7-x86_64

distro,profile管理

cobbler distro copy --name xxx --newname yyy
cobbler profile copy --name xxx --newname yyy

其它add copy edit 同理.看看help

kickstart配置

yum install system-config-kickstart -y
system-config-kickstart #安装x11可以图形化设置生成ks文件

cobbler-web

htdigest /etc/cobbler/users.digest "Cobbler" cobbler #改密码
htdigest /etc/cobbler/users.digest "Cobbler" sylar #新建用户

https://192.168.10.250/cobbler_web #注意必须使用https

cobbler-dhcp冲突

如果在一个局域网中有多个dhcp服务器的,开启cobbler上的dhcp服务会干扰目前正在运行的dhcp服务器的话,只需把cobbler上的dhcp的range网络段给注释掉即可,就是变成只能指定分配ip.同时使用不同的网段

cobbler system add --name=network --ip=172.16.0.0/16 --profile=net-x86_64

cobbler安装配置.基本全了多看help和docs的更多相关文章

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

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

  2. cobbler安装配置(二)

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

  3. Cobbler安装配置简单使用

    安装Cobbler [root@linux-node3 ~]# yum -y install epel-release [root@linux-node3 ~]# yum -y install cob ...

  4. 【云计算】ubuntu下docker安装配置指南

    Docker Engine安装配置 以下描述仅Docker在Ubuntu Precise 12.04 (LTS).Ubuntu Trusty 14.04 (LTS).Ubuntu Wily 15.10 ...

  5. python操作三大主流数据库(3)python操作mysql③python操作mysql的orm工具sqlaichemy安装配置和使用

    python操作mysql③python操作mysql的orm工具sqlaichemy安装配置和使用 手册地址: http://docs.sqlalchemy.org/en/rel_1_1/orm/i ...

  6. Android-x86虚拟机安装配置全攻略

    转自Android-x86虚拟机安装配置全攻略 注:这里安装从简,具体请参考虚拟机Vmware安装运行安卓4.0详细教程 Android-x86虚拟机安装配置网上有很多,但是全部说明白的确不多,希望这 ...

  7. Linux --- vim 安装、支持python3的配置、插件自动补全YCM的安装配置及全过程错误总结

    1.git(用来下载vim和相关插件) sudo apt-get install git 2,cmake(用来编译clang-llvm) sudo apt-get install build-esse ...

  8. Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程

    Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程 前言 第一步:下载Elasticsearch6.2.2 第二步:创建应用程序目录 第四步:创建Elastics ...

  9. Centos7 下cobbler安装及配置

    1.背景介绍 作为运维,在公司经常遇到一些机械性重复工作要做,例如:为新机器装系统,一台两台机器装系统,可以用光盘.U盘等介质安装,1小时也完成了,但是如果有成百台的服务器还要用光盘.U盘去安装,就显 ...

随机推荐

  1. hdu4416 Good Article Good sentence (后缀数组)

    题意:问a串中有多少种字符串集合B中没有的连续子串. a的长度10^5,B中的总长度为不超过10^5. 解法:后缀数组题目:后缀数组能够非常easy算出来一个串中有多少种子串. 把a和B集合连起来.求 ...

  2. outb,inb等I/Oport操作函数

    功能: 如 i386 .在差别 I/O 空间和内存空间的进程的 I/O 空间写入数据. outb()   I/O 上写入 8 位数据 ( 1 字节 ). outw() I/O 上写入 16 位数据 ( ...

  3. minicom在虚拟机(linux)安装配置过程

    1. minicom须要ncurses库的支持.否则安装会有问题. A. 下载ncurses.我选择是ncurses-5.6.tar.gz 下载地址:http://directory.fsf.org/ ...

  4. 使用Mybatis-Generator自己主动生成Dao、Model、Mapping相关文件

    准备工作: 1.数据库驱动程序 2.generatorConfig驱动,(下载地址:https://github.com/mybatis/generator/releases) 3.generator ...

  5. 腾讯云实力通过工信部测评,获全国范围CDN经营许可

    欢迎大家前往腾讯云社区,获取更多腾讯海量技术实践干货哦~ 近日,腾讯云提前完成了全国范围的CDN资质测评,顺利获得工信部颁发的CDN业务全国范围的经营许可证. 2017年1月份,工信部发布<关于 ...

  6. jmeter的使用---web测试

    jmeter的使用---web测试 url:http://127.0.0.1:1080/WebTours/ 1.通过badboy录制脚本 1.1输入url点击右侧的跳转按钮,随后右侧显示url界面 1 ...

  7. intellij idea 主题大全,看不惯idea 那2种主题的来这里了

    一直用默认的主题,但是白色的背景看久了会晃眼睛.所以打算换成黑色的. 不过Intellij只有两种主题,Default和Darcula. 现在只能自己手动安装一个了.新主题需要满足, 看久了不会太累. ...

  8. 使用WebEx录制视频并转换为MP4

    1.下载并安装WebEx http://www.question-defense.com/wp-content/uploads/2010/05/ateditor-version-3.0.zip 2.打 ...

  9. Laravel学习笔记(一)

         根据国外的调查,Laravel是最流行的框架,最近公司需要PHP的开发人员,但是一直招不到人,只好亲自上阵研究一下.由于以前对PHP只是大致了解,这次学习开始的时候也挺挠头的,到今天稍微入了 ...

  10. 【CSS3】内联、内部、外部样式,样式优先级、层叠、继承

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...