自動化-cobbler

cobbler功能node

安裝環境
centos7 linux

安裝步驟[ios

root@cabbler ~]# systemctl stop firewalld.serviceweb

[root@cabbler yum.repos.d]# rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm   安裝epel源vim

 yum install -y httpd dhcp tftp  cobbler 安裝包centos

 [root@cabbler yum.repos.d]# systemctl start httpdbash

[root@cabbler yum.repos.d]# systemctl start cobblerd服務器

[root@cabbler yum.repos.d]# cobbler check   ##安裝他須要裝的東西以及【配置】架構

[root@cabbler yum.repos.d]# cobbler get-loadersdom

[root@cabbler ~]# yum install xinetd -y

[root@cabbler ~]# openssl passwd -1 -salt '123456' '123456'     ############配置一個初始的默認密碼

$1$123456$wOSEtcyiP2N/IfIl15W6Z0

[root@cabbler ~]# vi /etc/cobbler/settings 修改配置文件

101 default_password_crypted: "$1$123456$wOSEtcyiP2N/IfIl15W6Z0"    ##########把密碼放到這

第384 改爲cobbler服務器IP     384行 修改 server: 10.0.0.61

第272行   272行修改  next_server: 10.0.0.61

[root@cabbler ~]# vim /etc/xinetd.d/tftp    改爲  disable                 = no

[root@cabbler ~]# systemctl start rsyncd

[root@cabbler ~]# systemctl restart xinetd

[root@cabbler ~]# systemctl enable rsyncd

[root@cabbler ~]# yum install pykickstart -y

配置dhcp

[root@cabbler /]# vim /etc/cobbler/settings

manage_dhcp: 1  改爲1 啓用

[root@cabbler /]# vim /etc/cobbler/dhcp.template    配置路由以及地址段

     option routers             192.168.1.1;
     option domain-name-servers 192.168.1.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.1.200 192.168.1.254;

[root@cabbler /]# cobbler sync   ###改cobbler配置文件就要同步

掛載個鏡像掛載到/mnt/centos7下

 [root@cabbler /]# cobbler import --path=/mnt/centos7/ --name=centos7 --arch=x86_64   #### 找到掛載的鏡像,起個名字,指定是多少位

[root@cabbler kickstarts]# cd /var/lib/cobbler/kickstarts

[root@cabbler kickstarts]# vim centos7_cobbler.cfg

#obbler for Kickstart Configurator for CentOS 7 by zhao 
install
url --url=$tree  
text
lang en_US.UTF-8
keyboard us
zerombr
bootloader --location=mbr 
# Network information
$SNIPPET('network_config')
timezone --utc Asia/Shanghai
rootpw  --iscrypted $default_password_crypted
clearpart --all --initlabel
part /boot --fstype xfs --size 1024 
part swap --size 1024 
part / --fstype xfs --size 1 --grow 
auth --useshadow --enablemd5
reboot
firstboot --disable
selinux --disabled
logging --level=info
skipx
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end
%packages
@base
@compat-libraries
@debugging
@development
tree
nmap
sysstat
lrzsz
dos2unix
telnet
iptraf
ncurses-devel
openssl-devel
zlib-devel
OpenIPMI-tools
screen
%end
%post
systemctl disable postfix.service
%end

 [root@cabbler kickstarts]# cobbler profile list
   centos7-x86_64
[root@cabbler kickstarts]# cobbler profile edit --name centos7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos7_cobbler.cfg  ###修改參數

[root@cabbler kickstarts]# cobbler profile edit --name centos7-x86_64 --kopts='net.ifnames=0 biosdevname=0'    ##更改網卡參數變成eth0

[root@cabbler kickstarts]# cobbler sync   ##時刻注意同步

[root@cobbler ~]# yum install cobbler-web -y  ###安裝cobblerweb

[root@cobbler ~]# systemctl restart httpd

https://192.168.1.102/cobbler_web     #######輸入帳號密碼  

 [root@cobbler ~]# vim /etc/cobbler/users.conf   ##帳號文件

[root@cobbler ~]# vim /etc/cobbler/users.digest    ####密碼文件

[root@cobbler ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler  輸入帳號密碼

[root@cobbler config]# cobbler repo add --name=Centos-7 --mirror=https://mirrors.aliyun.com/epel/7Server/x86_64/ --arch=x86_64 --breed=yum   ####建立YUM倉庫   指定名字-----路徑-------X86_64架構#

[root@cobbler config]# cobbler reposync  #####自動下載鏡像並自動構建倉庫

 [root@cobbler cobbler]# cobbler system add --name=linux-node1 --mac=00:50:56:3D:CB:D7 \ --profile=centos7-x86_64 \ --ip-address=10.0.0.11 --subnet=255.255.255.0 \ --gateway=10.0.0.1 --interface=eth0 \ --static=1 --hostname=linux-node1.example.com \ --name-servers="114.114.114.114 8.8.8.8" \ --kickstart=/var/lib/cobbler/kickstarts/centos7_cobbler.cfg  ##經過MAC指定安裝

[root@cobbler cobbler]# yum install -y koan         ###從新安裝系統須要安裝koan   須要EPEL源

[root@cobbler cobbler]# koan --server=192.168.1.102 --list=profiles

[root@cobbler config]# koan --replace-self --server=192.168.1.102 --profile=centos7-x86_64               指定安裝

相關文章
相關標籤/搜索