标签:cobbler
安装EPEL源
rpm -ivh epel-release-6-8.noarch.rpm
yum安装cobbler和依赖
yum install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes cman pykickstart system-config-kickstart debmirror cobbler-web koan syslinux -y
配置cobbler
vim /etc/cobbler/settings
manage_dhcp: 1#启用cobbler管理DHCP功能
manage_rsync: 1#启用cobbler管理rsync功能
next_server: 192.168.80.10#DHCP服务地址
server: 192.168.80.10#cobbler服务地址
检查关闭iptables和selinux
/etc/init.d/iptables stop
vim /etc/sysconfig/selinux
SELINUX=disabled
配置tftp和rsync
vim /etc/xinetd.d/tftp
disable no
vim /etc/xinetd.d/rsync
yes都改成no
启用wsgi模块
vim /etc/httpd/conf.d/wsgi.conf
去掉注释
#LoadModule
生成Cobbler安装系统root初始密码
这里生成密钥和配置默认密钥,ks文件引用
openssl passwd -1 -salt ‘random-phrase-here‘ ‘123456‘
将密钥加入配置文件中
vim /etc/cobbler/settings
default_password_crypted: 密钥
配置DHCP
cp /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.$(date +%F) #备份
vim /ect/cobbler/dhcp.template
subnet 192.168.80.0 netmask 255.255.255.0 {
option routers 192.168.80.2;
option domain-name-servers 114.114.114.114;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.80.100 192.168.80.254;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
配置相关服务开机自启动
配置相关服务开启自启动
/etc/init.d/httpd start
/etc/init.d/dhcpd start
/etc/init.d/xinetd start
/etc/init.d/cobblerd start
chkconfig httpd on
chkconfig dhcpd on
chkconfig cobblerd on
chkconfig xinetd on
chkconfig tftp on
下载引导操作系统文件
cobbler get-loaders
配置debmirror
yum install debmirror -y
修改/etc/debmirror.conf文件
#@dists="sid";#@arches="i386";
检查Cobbler配置
cobbler check
同步配置
cobbler sync
配置管理Cobbler
Cobbler命令说明
cobbler check 检查Cobbler配置
cobbler list 列出所有的cobbler元素
cobbler report 列出元素的详细信息
cobbler distro 查看导入的发行版系统信息
cobbler system 查看添加的系统信息
cobbler sync 同步Cobbler配置,更改配置最后都要执行下
Cobbler配置文件说明
Cobbler配置文件存放在/etc/cobbler下
/etc/cobbler/settingsCobbler主配置文件
/etc/cobbler/users.digest用于web访问的用户名密码配置文件
/etc/cobbler/modules.conf模板配置文件
/etc/cobbler/users.confCobbler webUI/web 服务授权配置文件
/etc/cobbler/isoBuildiso模板配置文件
/etc/cobbler/power电源配置文件
/etc/cobbler/pxePxeprofile配置模板
/etc/cobbler此目录页包含rsync、dhcp、dns、pxe、dnsmasq等服务的模板配置文件
系统镜像数据目录/var/www/cobbler
导入的系统发行版,repos镜像和kickstart文件都 放置于/var/www/cobbler目录下
确保/var目录有足够的空间来存储这些文件
/var/www/cobbler/images/存储所有导入发行版的Kernel和initrd镜像用于远程网络启动
/var/www/cobbler/repo_mirror/仓库存储目录
/var/log/cobblerCobbler日志文件 cobbler.log install.log
Cobbler数据目录/var/lib/cobbler
此目录存储和Cobbler profiles、systems、distros相关的配置
/var/lib/cobbler/config/存放distros、repos、systems和profiles等信息配置文件,一般都是json文件
/var/lib/cobbler/snippets/存放ks文件可以导入的脚本小片段
/var/lib/cobbler/triggers存放用户定义的cobbler命令
/var/lib/cobbler/kickstart/存放kickstart配置文件
相关日志文件
web日志存放点
/var/log/httpd/access_log
/var/log/httpd/error_log
/var/log/httpd/ssl_access_log
/var/log/httpd/ssl_error_log
Cobbler日志
/var/log/cobbler/cobbler.log
/var/log/cobbler/install.log
导入系统镜像
上传ISO镜像至服务器
创建ISO目录
mkdir -pv /opt/iso/Linux/CentOS/x86_64
mkdir -pv /opt/os/Linux/CentOS/x86_64/Centos6.5/dvd
挂载ISO镜像
mount -o loop /opt/iso/Linux/CentOS/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso /opt/os/Linux/CentOS/x86_64/Centos6.5/dvd/
从DVD中导入OS数据
系统版本命名为centos6.5架构x86_64,可查看ls /var/www/cobbler/ks_mirror/centos6.5-x86_64/目录文件生成情况
cobbler import --path=/opt/os/Linux/CentOS/x86_64/Centos6.5/dvd --name=Centos6.5 --arch=x86_64
列出导入后的配置
cobbler list
列出详细信息可以使用cobbler report
删除导入的系统
cobbler profile find --distro=centos6.5-x86_64 #查看配置是否存在
cobbler profile remove --name=centos6.5-x86_64 #删除distro
cobbler profile find --distro=centos6.5-x86_64 #再查看配置已无
自定义ks
更改kickstart文件,可为http等,具体cobbler --help查看,这里我们自定制ks文件
ks目录
/var/lib/cobbler/kickstart/
更改指定版本对应的ks配置文件
cobbler profile edit --name=Centos6.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6.5.cfg
配置信息查看
cobbler report
同步Cobbler配置
建议先执行cobbler check进行配置检查再执行cobbler sync,修改cobbler配置后都需要执行此步骤
ks文件示例
#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 --disable # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang zh_CN # 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
本文出自 “八英里” 博客,谢绝转载!
标签:cobbler
原文地址:http://5921271.blog.51cto.com/5911271/1769707