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

What is the automatic installation and configuration of cobbler based on centos7 series

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article to share with you is based on centos7 series cobbler automatic installation configuration is how, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.

Centos7.6-based scripts, centos7 should be applicable, execute scripts to maintain normal access to the public network, can use yum installation software normally

Example ks configuration file centos7.6ks.cfg clears disk sda's mbr and all partitions by default. Note that

According to ks configuration template, add and delete software packages, adjust partition size, add custom commands, etc.

#!/ bin/bash#====================================================# Author: Mr.Song# Create Date: 2019-10-11# Description: auto install config cobbler#====================================================###########################################wanning!!!! ks config file default clear sda mbr and all partition!!!!!# wanning!!!! ks config file default clear sda mbr and all partition!!!!!# wanning!!!! ks config file default clear sda mbr and all partition!!!!!########################################### cobbler web url:https://SERVER_IP/cobbler_web#cobbler web user/pass:cobbler/cobblerset -x systemctl stop firewalld&& systemctl disable firewalldsetenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinuxyum install -y epel-release ||'echo "install epel yum error,please check network or yum config" &&exit 1'yum -y install cobbler dhcp httpd xinetd tftp-server syslinux pykickstart rsync cobbler-web debmirror pykickstart fence-agents || 'echo "install cobbler error,please check network or yum config" &&exit 1'systemctl restart httpd xinetd rsyncd && systemctl enable httpd xinetd rsyncd dhcpdSERVER_IP=`ifconfig | grep broadcast | grep -v 172 | awk -F" " '{print $2}'`SERVER_NET_ADDR=`echo $SERVER_IP | awk -F". " '{print $1,$2,$3}'|sed 's/[[:space:]]/./ g'`sed -ri "s/^(manage_dhcp: ).*/\ 11/" /etc/cobbler/settingssed -ri "s/^(next_server: ).*/\ 1$SERVER_IP/" /etc/cobbler/settingssed -ri "s/^(server: ).*/\ 1$SERVER_IP/" /etc/cobbler/settingssed -ri "/disable/s/yes/no/" /etc/xinetd.d/tftpsed -ri "s#192.168.1#$SERVER_NET_ADDR#g;/option routers/s#192.168.10.5#$SERVER_IP#;/option domain-name-servers/s#192.168.10.1#$SERVER_IP#;/next-server/s#\$next_server#$SERVER_IP#" /etc/cobbler/dhcp.template#COBBLER_PASS=`openssl passwd -1 -salt 'test' '111111'`#sed -ri "s/^(default_password_crypted: ).*/\ 1"$COBBLER_PASS"/" /etc/cobbler/settingssystemctl enable cobblerd && systemctl restart cobblerd if [ $? -ne 0 ];then echo "cobbler service error,please check log error" exit 1fisleep 3cobbler get-loaders ||'echo "get sample file fail,please check config"&&exit 1'sed -i '/@dists="sid";/s/^/#/;/@arches="i386";/s/^/#/' /etc/debmirror.confcobbler syncsystemctl restart cobblerd cat > /var/lib/cobbler/kickstarts/centos7.6ks.cfg

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