Install Cobbler Automation deployment software in CentOS

Source: Internet
Author: User
Tags rsync yum repolist

#!/bin/bash
#
#cobbler server Address
ip=192.168.119.133
#DHCP server NET and address Fanwei
net=192.168.119.0
begin=192.168.119.150
end=192.168.119.200
dns=202.96.209.133
#firewall setting
Sed-i-E ' s/selinux=enforcing/selinux=disabled '/etc/sysconfig/selinux
Setenforce 0
Iptables-i input-m State--state new-m tcp-p TCP--dport 80-j ACCEPT
Iptables-i input-m State--state new-m tcp-p TCP--dport 25151-j ACCEPT
Iptables-i input-m State--state new-m udp-p UDP--dport 69-j ACCEPT
Service Iptables Save
Service Iptables Restart
#hostname setting
echo "$ip www.cobbler.com" >>/etc/hosts
#install Epel and config Epel
wget http://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm
RPM-IVH epel-release-latest-6.noarch.rpm
Rm-rf/var/run/yum.pid
Yum Repolist
Yum-y Install cobbler cobbler-web pykickstart dhcp httpd debmirror rsync cman fence-agents python-ctypes System-config-ki Ckstart
/etc/init.d/iptables stop
/ETC/INIT.D/HTTPD start
/etc/init.d/xinetd start
/etc/init.d/cobblerd start
Service Cobblerd Restart
Cobbler Get-loaders
Sed-i-E ' s/= yes/= no/g '/etc/xinetd.d/rsync
Sed-i-E ' s/= yes/= no/g '/etc/xinetd.d/tftp
Sed-i ' [email protected]_server: [email protected]_server: ' $ip ' @g '/etc/cobbler/settings
Sed-i ' [email protected]: [email protected]: ' $ip ' @g '/etc/cobbler/settings
Sed-i ' [email protected][email protected]#[email protected] '/etc/cobbler/settings
echo "default_password_crypted:" $ (OpenSSL passwd-1-salt ' random-phrase-here "[email protected] ')" ">>/etc/ Cobbler/settings
#cp/usr/share/syslinux/pxelinux.0/var/lib/cobbler/loaders/
#cp/usr/share/syslinux/meminfo.c32/var/lib/cobbler/loaders/
Service Cobblerd Restart
Cobbler Sync

Cat >/etc/dhcp/dhcpd.conf << EOF
Option Domain-name "cobbler.com";
Option Domain-name-servers $dns;
Default-lease-time 43200;
Max-lease-time 86400;
Log-facility Local7;
Subnet $net netmask 255.255.255.0 {
Range $begin $end;
option routers $ip;
}
Next-server $ip;
Filename= "pxelinux.0";
Eof
Service Cobblerd Restart
Service xinetd Restart
Service DHCPD Start
#mount System ISO File
Mkdir/opt/cobbler
Mount/dev/cdrom/opt/cobbler
Cobbler Import--name=centos-6.7-x86_64--path=/opt/cobbler
Cobbler profile Add--name=auto_install_centos-6.7--distro=centos-6.7-x86_64--kickstart=/var/lib/cobbler/ Kickstarts/ks.cfg

Install Cobbler Automation deployment software in CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.