自動化ツールcobberでCentOS 6をパッチにインストール手順

1.cobblerをインストール、設定
1.1 epelソースパッケージを導入
# rpm -ivh epel-release-6-8.noarch.rpm
# yum update
# yum upgrade
1.2 cobblerをインストール
# yum install cobbler

1.3 構成内容を修正
# vi /etc/cobbler/settings ,
next_server: 192.168.1.120 #IP of Cobbler server
server: 192.168.1.120 #IP of Cobbler server
manage_dhcp: 1 #cobblerでDHCPを管理

1.4 httpd、xinetd、cobblerが起動
# /etc/init.d/httpd start
# /etc/init.d/xinetd start
# /etc/init.d/cobblerd start (selinuxを無効)

# chkconfig httpd on
# chkconfig xinetd on
# chkconfig cobblerd on

1.5 rsyncとtftpのxinetd設定内容を編集
vi /etc/xinetd.d/rsync
修正内容: disable = no
vi /etc/xinetd.d/tftp
修正内容: disable = no

1.6 ファイアーウォールとselinuxを閉じる、再起動
# /etc/init.d/iptables stop
# chkconfig iptables off
# vi /etc/sysconfig/selinux
修正内容:SELINUX=disabled
# reboot

1.7 cobbler loadersをインストール
cobbler get-loaders

1.8 パスワードのhash値を生成
openssl passwd -1 -salt ‘since’ ‘since2014’
hash値:$1$$05Gidn0z8BjDu2ZbV4fS.0

1.9 vim /etc/cobbler/settings
default_password_crypted: “$1$$05Gidn0z8BjDu2ZbV4fS.0”

2.cobbler設定内容をチェック、編集

2.1 dhcpファイルを編集
/etc/cobbler/dhcp.template
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option domain-name-servers 192.168.1.120;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.101 192.168.1.130;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
class “pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = “PXEClient";
if option pxe-system-type = 00:02 {
filename “ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename “grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename “grub/grub-x86_64.efi";
} else {
filename “pxelinux.0";
}
}
}
2.2 イメージファイルをインポート
例 /root/CentOS-6.0-x86_64-bin-DVD1.iso
mount -o loop /root/CentOS-6.0-x86_64-bin-DVD1.iso /mnt/
cobbler import –path=/mnt/ –name=cent60-x86_64

2.3 cobblerを再起動、同期する
/etc/init.d/cobblerd restart
cobbler sync

2.4 設定内容を確認
cobbler listまたは cobbler report

Linux

Posted by arkgame