Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cobbler Automation unattended installation (actual combat! )

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Cobbler introduces that Cobbler is a service installed by a Linux server, which can quickly install and reinstall physical servers and virtual machines through network startup (PXE), as well as manage DHCP,DNS and so on. Cobbler can be managed by command line, and it also provides Web-based interface management tool (cobbler-web) and API interface, which is convenient for secondary development. Cobbler is an upgraded version of the earlier kickstart, which has the advantage of being relatively easy to configure and easy to manage with its own web interface. Cobbler has a lightweight configuration management system built in, but it also supports integration with other configuration management systems, such as Puppet, but does not support SaltStack for the time being. one, Install cobbler and necessary components [root@localhost ~] # yum install epel-release-y # # install epel source [root@localhost ~] # yum install-y\ > cobbler\ # install cobbler\ > cobbler-web\ # # Web form Management > dhcp\ # # address allocation Service > tftp-server\ # # put compressed and boot files > pykickstart\ # # Python development Kickstart > httpd\ # # Network Services > rsync\ # # remote synchronization Management > xinetd # # Management platform 2 Modify cobbler configuration file [root@localhost ~] # cd / etc/cobbler/ [root@localhost cobbler] # vim settings # # modify configuration file next_server: 192.168.13.140 # # change the service address to local server: 192.168.13.140manage_dhcp: 1 # # dhcp enable [root@localhost cobbler] # systemctl start httpd.service # # enable http service [root@localhost cobbler] # systemctl start cobblerd.service # # enable Start the cobbler service [root@localhost cobbler] # systemctl stop firewalld.service # # turn off the firewall [root@localhost cobbler] # setenforce 0 # # turn off enhancements 3 Optimize cobbler [root @ localhost cobbler] # cobbler check # # cobbler detect the items that need to be optimized # # the things that need to be optimized are listed below According to the optimization item, you can optimize [root@localhost cobbler] # vim / etc/xinetd.d/tftp # # for tftp optimization service tftp {socket_type = dgram protocol = udp wait = yes user = root server = / usr/sbin/in.tftpd server_args =-s / var/lib/tftpboot disable = no # # here yes is changed to no per_source = 11 cps = 100 2 flags = IPv4} [root@localhost cobbler] # systemctl enable rsyncd.service # # optimize to enable the remote synchronization management service [root@localhost cobbler] # openssl passwd-1-salt 'abc123'' abc123' # # optimize the administrator password $1 $abc123 $9v8z2./E/PZihXrVcy3II0 # # copy this ciphertext after salt encryption [root@localhost cobbler] # vim / etc/cobbler/settings # # modify the configuration file # # find the default Then copy the encrypted ciphertext here default_password_crypted: "$1 $abc123 $9v8z2./E/PZihXrVcy3II0" [root@localhost cobbler] # systemctl start rsyncd.service # # start the service [root@localhost cobbler] # systemctl restart xinetd.service 4 Configure dhcp service [root@localhost cobbler] # vim / etc/cobbler/dhcp.template # # modify configuration file subnet 192.168.13.0 netmask 255.255.255.0 {# # modify network segment option routers 192.168.13.1 # # Gateway option domain-name-servers 192.168.13.2; # # dns address option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.13.100 192.168.13.200 # # address pool [root@localhost cobbler] # cobbler sync # # synchronously generate DHCP configuration files (/ etc/dhcp/dhcpd.conf) [root@localhost cobbler] # systemctl restart dhcpd.service # # start the dhcp service [root@localhost cobbler] # systemctl start cobblerd.service # # start the cobbler service [root@localhost cobbler] # systemctl start xinetd.service # # start the management platform service 5, and connect the image file before importing the ISO image file And mount to / mnt directory [root@localhost cobbler] # mount / dev/cdrom / mnt # # Mount the image to / mnt directory mount: / dev/sr0 write protection [root@localhost cobbler] # cd / mnt/ [root@localhost mnt] # ls # # View image file CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7EFI images Packages RPM-GPG-KEY-CentOS-Testing-7EULA isolinux repodata TRANS.TBL import image file [root@localhost mnt] # cobbler import-- path=/mnt/-- name=Centos-7-x86_64- -arch=x86_64## imports the image file to indicate the path Generate the name [root@localhost mnt] # cd / var/www/cobbler/ks_mirror/ # # switch to the cobbler directory [root@localhost ks_mirror] # lsCentos-7-x86_64 config [root@localhost ks_mirror] # cobbler list # # View file information distros: Centos-7-x86_64profiles: Centos-7-x86_64systems:repos:images:mgmtclasses:packages:files: view compressed kernel and boot files [root@localhost ks] _ mirror] # yum install tree-y # # install the tree tool [root@localhost ks_mirror] # tree / var/lib/tftpboot/images # # View the compressed kernel and boot file / var/lib/tftpboot/images └── Centos-7-x86_64 ├── initrd.img # # boot file └── vmlinuz # # compress kernel full restart service [root@localhost ks_mirror] # systemctl restart Cobblerd.service [root@localhost ks_mirror] # systemctl restart dhcpd.service [root@localhost ks_mirror] # systemctl restart xinetd.service [root@localhost ks_mirror] # systemctl restart httpd.service 6 Create a virtual machine without a system and turn on the automatic installation system (character interface)

Install graphical interface code: [root@localhost ~] # yum groupinstall "GNOME Desktop" code: [root@localhost ~] # yum groupinstall 'KDE Plasma Workspaces "- y code: [root@localhost ~] # yum groupinstall" X Window System "or" Graphical Administration Tools "7 Use cobbler's web management [root@localhost ks_mirror] # vim / etc/cobbler/modules.conf # # configuration module configuration file module = authn_configfile # # default to enable [root@localhost ks_mirror] # htdigest-c / etc/cobbler/users.digest Cobbler adadmin # # create user password Adding password for adadmin in realm Cobbler.New password: # # enter password Re-type new password: [root@localhost ks_mirror] # systemctl restart cobblerd.service # # restart cobbler service [root@localhost ks_mirror] # systemctl restart httpd.service # # restart httpd service 8 Web Management of Web Page access cobbler

9. Enable pam authentication, log in to [root@localhost ks_mirror] # vim / etc/cobbler/modules.conf # # modify the configuration file of the module [authentication] module = authn_pam # # modify the pam authentication module [authorization] module = authz_ownership # # specify the access right [root@localhost ks_mirror] # useradd webuser # # create the system user [root@localhost ks_mirror] # passwd webuser # # set the password of the user webuser. New password: invalid password: password less than 8 characters re-enter the new password: passwd: all authentication tokens have been successfully updated. [root@localhost ks_mirror] # vim / etc/cobbler/users.conf # # modify the users.conf file under cobbler [admins] admin = "" cobbler = "" webuser = "" # # add a user [root@localhost ks_mirror] # systemctl restart httpd.service # # restart the service [root@localhost ks_mirror] # systemctl restart cobblerd.service 10, and log in to the web management page

Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report