A Brief Introduction to cobbler
Operational and maintenance automation includes standardization, instrumentation, Web-based, service-based and intelligent levels. In a production environment with a slightly larger scale and thousands or even tens of thousands of servers, instrumentation system installation process and unified system installation criteria are the least in order to truly realize operational and maintenance automation. Important links that can be ignored. Ordinary automatic deployment can be realized by using pxe+dhcp+tftp with kickstart, but in the case of multi-version and Multi-Deployment requirements, this common deployment method may not meet our requirements; at this time, we need to use cobbler open source automation deployment tools to achieve.
Cobbler is a fast network system deployment tool. Its greatest feature is that it aggregates all the services needed for system deployment, such as DHCP, DNS, TFTP, so that when you deploy an operating system, you don't need to coordinate switching before each service. Cobbler can be managed for you. Cobbler integrates a mirror version inside. In this warehouse, you can customize the configuration files to meet the different installation requirements of different systems. Of course, Cobbler also provides functions such as yum source management, Web interface management, API interface, power management, etc. to facilitate your customized development and management.
cobbler Design Method
-
Distribution:
Represents an operating system. It carries information about the kernel and initrd, as well as other data such as kernel parameters.
-
Profile:
Include a distribution, a kickstart file, and a possible repository, as well as more specific kernel parameters and other data
-
System:
The machine to be rationed. It contains a configuration file or a mirror, as well as IP and MAC addresses, power management (address, credentials, type), and more professional data.
-
Repository:
Store mirror information for a yum or rsync repository
-
Image:
Substitute a distribution object that contains files that do not belong to this category (for example, objects that cannot be divided into kernels and initrd objects)
II. cobbler Installation
1.cobbler is in the epel source. If there is no EPELi source in the system, install it first.
[root@sharestore py-9]# yum search epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
============================ N/S matched: epel-release ============================
epel-release.noarch : Extra Packages for Enterprise Linux repository configurationName and summary matches only, use "search all" for everything.
[root@sharestore py-9]# yum -y install epel-release2.install cobbler
[root@sharestore py-9]# yum -y install cobbler
See which files are installed and where
[root@sharestore py-9]# rpm -ql cobbler
Here are some important configuration files and instructions:
/etc/cobbler # Configuration file directory /etc/cobbler/settings # cobbler master configuration file /etc/cobbler/dhcp.template # Configuration templates for DHCP services /etc/cobbler/tftpd.template # Configuration template for tftp service /etc/cobbler/rsync.template # Configuration template for rsync service /etc/cobbler/iso # iso template configuration file directory /etc/cobbler/pxe # pxe template file directory /etc/cobbler/power # Power Configuration File Directory /etc/cobbler/users.conf # Web Services Authorization Profile /etc/cobbler/users.digest # User Name Password Profile for web Access /etc/cobbler/dnsmasq.template # Configuration template for DNS services /etc/cobbler/modules.conf # Cobbler module configuration file /var/lib/cobbler # Cobbler Data Catalogue /var/lib/cobbler/config # configuration file /var/lib/cobbler/kickstarts # Default store kickstart file /var/lib/cobbler/loaders # Stored bootstraps /var/www/cobbler # System Installation Mirror Directory /var/www/cobbler/ks_mirror # Imported System Mirror List /var/www/cobbler/images # Imported System Mirror Startup File /var/www/cobbler/repo_mirror # yum source storage directory /var/log/cobbler # Log directory /var/log/cobbler/install.log # Client System Installation Log /var/log/cobbler/cobbler.log # cobbler log
III. cobbler Initial Configuration
1. Start the cobbler service
cobbler relies on httpd services, so start httpd first or it will report an error.
[root@sharestore]# systemctl start cobbler
2. Run cobbler check to modify the configuration based on prompts
[root@sharestore]# cobbler check
[root@sharestore ~]# cobbler check
The following are potential configuration items that you may want to fix:1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
#This prompt is that you need to modify the server in the / etc/cobbler/settings file: the following IP address, which by default is 127.0.0.1, needs to be changed to the real local network card address that can be communicated to provide DHCP and other services.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
#The hint is that to make PXE work, you need to set the next_server IP address in / etc/cobbler/settings, as well as the IP address that you can communicate with.
3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
https://github.com/cobbler/cobbler/wiki/Selinux#This prompt requires that selinux be turned off
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp#Prompt to enable tftp
5 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.#Tips for downloading bootstraps from the Internet using cobbler get-loaders
6 : enable and start rsyncd.service with systemctl#Prompt to start rsyncd service
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories
8 : ksvalidator was not found, install pykickstart#The prompt requires pykickstart to be installed, and you can use yum-y pykickstart.
9 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try:default_password_crypted "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one#Prompt to change the default password "openssl passwd-1-salt'random-phrase-here''your-password-here'" and replace the default_password_crypted quotation marks in settings
10 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
# Hint to install cman or fence-agents if using power management module