一、简介
二、安装 CentOS 7 调整配置及安装相关软件
1 、调整配置
2 、安装 epel 包
3 、安装 cobbler 、 cobbler-web 以及相关依赖软件
4 、设置开机启动
三、 Cobbler 、 tftp 、 dhcp 、 rsync 配置
1 、 TFTP 配置
2 、配置 rsync
3 、配置 /etc/cobbler/settings
4 、修改 /etc/cobbler/modules.conf
5 、修改 /etc/cobbler/dhcp.template
6 、重启 cobbler httpd 服务
四、检查 cobbler 配置
五、导入镜像并查看导入情况
1 、导入镜像
2 、查看
六、编辑 seed 文件
1 、普通分区配置
2 、 lvm 分区配置
七、注意事项
八、截图
一、简介Cobbler 是红帽开发的批量部署系统的工具,对 RHEL 、 CentOS 支持完美
对其他发行版的 linux 部分支持,也不是很完美
本文介绍的是基于 CentOS 7 上安装 cobbler 2.6 的文档
参照了网上的一些教程和官方文档,加上自己的实践,特别是分区部分,调试了数十次才算完美了。
二、安装 CentOS 7 调整配置及安装相关软件 1 、调整配置安装完成后关闭 selinux 或参照 cobbler 官方文档设置 selinux , http://cobbler.github.io/manuals/2.6.0/4/2_-_SELinux.html
[root@cobbler-server ~]# sed-i'/SELINUX/s/enforcing/disabled/'/etc/selinux/config重启服务器
关闭 iptables 以及取消开机启动, centos7 minimal 没有安装 ipables
关闭 firewall 或放行 80 67 68 69 443 端口
80 443 是 cobbler web 管理界面端口
67 68 是 DHCP 端口
69 是 TFTP 端口
[root@cobbler-server ~]# systemctl stop firewalld [root@cobbler-server ~]# systemctl disable firewalld 2 、安装 epel 包 [root@cobbler-server ~]# yum install epel-release [root@cobbler-server ~]# yum makecache 3 、安装 cobbler 、 cobbler-web 以及相关依赖软件 [root@cobbler-server ~]# yum install cobbler cobbler-web xinetd pykickstart cman dhcp -y 4 、设置开机启动 [root@cobbler-server ~]# systemctl enable httpd [root@cobbler-server ~]# systemctl enable dhcpd [root@cobbler-server ~]# systemctl enable cobblerd 三、 Cobbler 、 tftp 、 dhcp 、 rsync 配置 1 、 TFTP 配置配置 tftp 绿色着色为修改后的值
[root@cobbler-server ~]# vim /etc/xinetd.d/tftp# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
2 、配置 rsync [root@cobbler-server ~]# systemctl enable rsyncdCentOS7 上安装 cobbler 对于 rsync 无需额外配置
3 、配置 /etc/cobbler/settings [root@cobbler-server ~]# cat /etc/cobbler/settings |grep '^[^#]'---
allow_duplicate_hostnames: 0
allow_duplicate_ips: 0
allow_duplicate_macs: 0
allow_dynamic_settings: 0
anamon_enabled: 0
authn_pam_service: "login"
auth_token_expiration: 3600
build_reporting_enabled: 0
build_reporting_sender: ""
build_reporting_email: [ 'root@localhost' ]build_reporting_smtp_server: "localhost"
build_reporting_subject: ""
build_reporting_ignorelist: [ "" ]cheetah_import_whitelist:
- "random"
- "re"
- "time"
createrepo_flags: "-c cache -s sha"
default_kickstart: /var/lib/cobbler/kickstarts/default.ks
default_name_servers: []default_ownership:
- "admin"
default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac."
default_template_type: "cheetah"
default_virt_bridge: xenbr0
default_virt_file_size: 5
default_virt_ram: 512
default_virt_type: xenpv
enable_gpxe: 0
enable_menu: 1
func_auto_setup: 0
func_master: overlord.example.org
http_port: 80
kernel_options:
ksdevice: bootif
lang: ' '
text: ~
kernel_options_s390x:
RUNKS: 1
ramdisk_size: 40000
root: /dev/ram0
ro: ~
ip: off
vnc: ~
ldap_server: "ldap.example.com"
ldap_base_dn: "DC=example,DC=com"
ldap_port: 389
ldap_tls: 1
ldap_anonymous_bind: 1
ldap_search_bind_dn: ''
ldap_search_passwd: ''
ldap_search_prefix: 'uid='
ldap_tls_cacertfile: ''
ldap_tls_keyfile: ''
ldap_tls_certfile: ''
mgmt_classes: []mgmt_parameters:
from_cobbler: 1
puppet_auto_setup: 0
sign_puppet_certs_automatically: 0
puppetca_path: "/usr/bin/puppet"
remove_old_puppet_certs_automatically: 0
manage_dhcp: 1 #cobbler 接管 DHCP, 默认为 0, 此处修改以后需要修改对应 /etc/cobbler/dhcp.template 模板manage_dns: 0
bind_chroot_path: ""
bind_master: 127.0.0.1
manage_tftpd: 1
manage_rsync: 1 # 接管 rsync ,无需额外配置 rsync manage_forward_zones: [] manage_reverse_zones: [] next_server: 192.168.11.252 # 本机 ip 地址power_management_default_type: 'ipmitool'
power_template_dir: "/etc/cobbler/power"
pxe_just_once: 0
pxe_template_dir: "/etc/cobbler/pxe"
consoles: "/var/consoles"
redhat_management_type: "off"
redhat_management_server: "xmlrpc.rhn.redhat.com"
redhat_management_key: ""
redhat_management