1. 程式人生 > >rhel6.9搭建cobbler自動化系統安裝伺服器(單系統)

rhel6.9搭建cobbler自動化系統安裝伺服器(單系統)

一、測試環境說明
	1、系統:rhel6.9
	2、ip地址:20.20.20.24/24
	3、以下操作使用root身份進行,也可以使用具有sudo許可權的使用者進行相關操作

二、環境準備
	1、關閉iptables防火牆、selinux
		# /etc/init.d/iptables stop
		# chkconfig iptables off
		# setenforce 0
		# sed -i '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
	2、設定hosts域名解析(可選)
		編輯 "/etc/hosts" 檔案

三、安裝軟體
	# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
	# yum install cobbler httpd rsync tftp-server xinetd dhcp pykickstart fence-agents system-config-kickstart

四、掛載
	略

五、修改配置檔案
	# sed -i 's/yes/no/' /etc/xinetd.d/tftp
	# sed -i 's/yes/no/' /etc/xinetd.d/rsync
	# vim /etc/httpd/conf/httpd.conf
		ServerName 20.20.20.22:80
	# openssl passwd -1
	Password:
	Verifying - Password:
	$1$BFaLgUBZ$9HX7WbrCz7fPEBkdk9FYV/
	# vim /etc/cobbler/settings
		manage_dhcp: 1
		manage_rsync: 1
		next_server: 20.20.20.24
		server: 20.20.20.24
		default_password_crypted: "$1$BFaLgUBZ$9HX7WbrCz7fPEBkdk9FYV/"
	# vim /etc/cobbler/dhcp.template
		subnet 20.20.20.0 netmask 255.255.255.0 {
		     option routers             20.20.20.2;
		     option domain-name-servers 20.20.20.2;
		     option subnet-mask         255.255.255.0;
		     range dynamic-bootp        20.20.20.121 20.20.20.130;
		     default-lease-time         21600;
		     max-lease-time             43200;
		     next-server                $next_server;

六、啟動相關服務
	httpd
	xinetd
	dhcpd
	cobblerd

	# cobbler check
	# cobbler get-loaders
	# cobbler sync

七、匯入安裝源
	# cobbler import --name=rhel6.9-x86_64 --path=/mnt/rhel6.9

八、建立ks檔案
	# system-config-kickstart

九、關聯ks檔案
	# cobbler profile edit --name=rhel6.9-x86_64 --distro=rhel6.9-x86_64 --kickstart=/var/lib/cobbler/kickstarts/rhel6.9.ks

# cobbler sync