Automatic operation and maintenance of Linux Automation installation system
For CentOS and Rhel
1 Setting the Epel source
rpm-ivh?http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Download your own installation
RPM-IVH epel-release-6-8.noarch.rpm
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
Installing Cobbler-related packages
If you want cobbler to manage dhcp,dns, you need to install both DNS and DHCP on the same machine. If you do not manage DNS, you may not install bind.
Yum-y Install Cman tftp-server dhcp cobbler cobbler-web bind Pykickstart httpd rsync xinetd
Installing Cobbler Dependency Packages
Yum install-y Ed Patch perl perl-compress-zlib perl-digest-sha1 perl-lockfile-simple Perl-libwww-perl
Add all services to boot
Chkconfig httpd on
Chkconfig DHCPD on
Chkconfig xinetd on
Chkconfig Cobblerd on
Modifying configuration profiles and starting services
TFTP service and Rsync service
Sed-i '/disable/c\tdisable\t\t\t= no '/etc/xinetd.d/tftp
Sed-i-E ' s/\=\ yes/\=\ no/g '/etc/xinetd.d/rsync
Service xinetd Restart
KS script turns off PXE so that it does not repeat the installation
Sed-i ' s/pxe_just_once:0/pxe_just_once:1/g '/etc/cobbler/settings
9:TFTP Server IP Address
Sed-i ' s/server:127.0.0.1/server:10.1.199.12/g '/etc/cobbler/settings
Sed-i ' s/next_server:127.0.0.1/next_server:10.1.199.12/g '/etc/cobbler/settings
10:cobbler managing Rsync
Sed-i ' s/manage_rsync:0/manage_rsync:1/g '/etc/cobbler/settings
11:cobbler managing DHCP
Sed-i ' s/manage_dhcp:0/manage_dhcp:1/g '/etc/cobbler/settings
The DHCP service has cobbler to manage/etc/cobbler/dhcp.template
Modify the content below to do so. Comment out the range DYNAMIC-BOOTP. Otherwise, a DHCP server will appear in your intranet.
Subnet 10.27.37.0 netmask 255.255.255.0 {
Option routers 10.27.37.254;
Option Domain-name-servers 10.27.37.200;
Option Subnet-mask 255.255.255.0;
#range DYNAMIC-BOOTP 10.27.37.100 10.27.37.150;
FileName "/pxelinux.0";
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $next _server;
}
Set root default password
This setting is valid only for CentOS. My default root password is: 123456
OpenSSL passwd-1-salt ' random-phrase-here ' 123456 '
$1$random-p$99lazjzel9uunsathe9om0
Modify/etc/cobbler/settings
#default_password_crypted: "$1$mf86/uhc$wvcicx2t6crbz2onwxyac."
default_password_crypted: "$1$random-p$99lazjzel9uunsathe9om0"
Start related services
/ETC/INIT.D/HTTPD restart
/etc/init.d/cobblerd restart
/etc/init.d/named restart
Start Menu
Cobbler Get-loaders (or put the loaders file under/var/lib/cobbler/loaders/)
Check Cobbler
Cobbler provides a tool to check your settings. When you see a hint, it means that all the work has been done.
All modifications to the cobbler are required
Cobbler Sync
Check
Cobbler Check
No configuration problems found. All systems go.
You can see that the zone file for DNS has been generated
ls/var/named/
10.27.37 test.com Data Dynamic named.ca named.empty named.localhost named.loopback Slaves
Four Configuration management Cobbler
4.1 Cobbler Command Description
Command name Command purpose
Cobbler Check Cobbler Configuration
Cobbler list lists all the cobbler elements
Cobbler report listing details of elements
Cobbler distro Viewing the imported release system Information
Cobbler System View added systems information
Cobbler Profile View configuration information
Cobbler Sync Sync Cobbler configuration, changing the configuration is best done under
Cobbler Reposync Sync Yum Warehouse
Command Reference
Cobbler--help
Cobbler Distro--help
Cobbler distro Add--help
4.2 Cobbler Configuration File description
Cobbler configuration file is stored under/etc/cobbler
The profile name is called a??? Use
/etc/cobbler/settings???? Cobbler Master configuration file
/etc/cobbler/users.digest???? User name password configuration file for Web Access
/ETC/COBBLER/NF???? Module configuration file
/ETC/COBBLER/NF???? Cobbler Webui/web Service Authorization
/etc/cobbler/iso/???? Buildiso Template Configuration file
/etc/cobbler/power???? Power configuration file
/ETC/COBBLER/PXE???? Pxeprofile Configuration Templates
/etc/cobbler???? This directory also contains template profiles for rsync, DHCP, DNS, PXE, DNSMASQ, and other services
4.3 System image Data Catalog/var/www/cobbler
The imported system releases, repos images, and kickstart files are placed in the/var/www/cobbler directory. Make sure that the/var directory has enough space to store the files.
Directory name for??? Use
/var/www/cobbler/images/store kernel and INITRD images for all imported distributions for remote network boot
/var/www/cobbler/ks_mirror/storage of imported release system data
/var/www/cobbler/repo_mirror/Warehouse Storage Directory
/var/log/cobbler Cobbler log File Cobbler.log?install.log
4.4 Cobbler Data Catalog/var/lib/cobbler
This directory stores and cobbler profiles, systems, distros-related configurations.
Directory name for??? Use
/var/lib/cobbler/config/stores information profiles such as distros, repos, systems, and profiles, typically JSON files
/var/lib/cobbler/snippets/Store KS files can be imported into a small fragment of script, worth studying
/var/lib/cobbler/triggers storing user-defined cobbler commands
/var/lib/cobbler/kickstarts/Storing Kickstart configuration files
4.5 Related log files
Web Log storage Point
/var/log/httpd/access_log
/var/log/httpd/error_log
/var/log/httpd/ssl_access_log
/var/log/httpd/ssl_error_log
Cobbler Log
/var/log/cobbler/cobbler.log
/var/log/cobbler/install.log
The installation state of the system can be obtained by cobbler log
Five Custom Systems
5.1 Importing Mirrors
Mkdir-p/mnt/centos6.5
Mount-o loop/root/centos-6.5-x86_64-bin-dvd1.iso/mnt/centos6.5/
Cobbler Import--path=/mnt/centos6.5/--name=centos6.5
It takes a few minutes to view the/VAR/WWW/COBBLER/KS_MIRROR/CENTOS5.5/directory file generation situation.
5.2 Information View
Cobbler report Information view
Cobbler distro List View import lists
Cobbler Profile List View profile
Cobbler Sync Sync Configuration
5.3 Customizing Kickstart files and Sinppet files
Centos6.5-test.ks
Custom KS files are placed in/var/lib/cobbler/kickstart/*ks;
The custom snippet file is placed under/var/lib/cobbler/snippet/;
5.4 Defining Cobbler Profile
Control Node Profile
Cobbler Import--path=/mnt/centos6.5/--name=centos6.5 generates a profile file (can be deleted) when execution is completed
Cobbler profile Add--name=centos6.5-test--kickstart=/var/lib/cobbler/kickstarts/centos6.5-test.ks--distro= centos6.5
/var/www/cobbler/pub Customizing the installation package placement location
90:e5:bc:13:5c:d6
Cobbler system Add--name=10-0-41-20--ip-address=10.0.41.20--mac=90:e5:bc:13:5c:d6--profile=centos6.6-x86_64-- KICKSTART=/VAR/LIB/COBBLER/KICKSTARTS/CENTOS-6.5-X86_64.KS--static=1
Viii. Add the specified client system configuration to Cobbler
- Specify a network segment to use a specific installed configuration
Cobbler system Add--name=test_000--ip=192.168.1.0/24--profile=centos-5.9-x86_64
- Add an installed configuration for a specified server
Specify the server's MAC address, and set the host name, IP address and other information, you need to be prompted to know the server MAC address, according to the MAC application to the specific machine.
You can also specify the KS parameter. --kickstart=/var/lib/cobbler/kickstarts/webserver.ks
Cobbler system Add--name=test_001--hostname=test_001--mac=90:0b:29:c3:71:54--interface=eth0--ip-address= 192.168.1.123--subnet=255.255.255.0--gateway=192.168.1.1--static=1--profile=centos-5.9-x86_64
- Modifying the System Configuration
Machine IP address changed to 192.168.10.110
Cobbler System Add--name=test_001--ip=192.168.1.110
Change the System configuration name
Cobbler System Rename--name=test001--newname=abc
- Remove System Configuration
The profile name that needs to be deleted is called test_001
Cobbler System Remove--name=test_001
- View a list of defined systems
Cobbler System List
test_001
Ix. Installing the client operating system
(1) PXE boot via NIC
(2) Auto-Complete installation
Ten, reload the client operating system
wget ftp://rpmfind.net/linux/epel/5/i386/koan-1.6.6-1.el5.noarch.rpm
RPM-IVH koan-1.6.6-1.el5.noarch.rpm
View the configuration file on the Cobbler server, the centos5.x system Koan cannot be installed with Yum, otherwise the Python version is too low to error. Koan--server=192.168.1.10--list=profilesReinstall the server's operating system
1. Install Koan on the client
Yum Install Koan
2. View the configuration files on the Cobbler server
Koan--server=192.168.0.2--list=profiles
3. Reinstall the client system
Koan--replace-self--server=192.168.0.2--profile=webserver1
4, reboot Restart the server, the client server will automatically reinstall the operating system
Linux Automated Installation System