$ yum install -y epel-release
$ yum install -y cobbler cobbler-web pykickstart debmirror xinetd
$ systemctl restart httpd
$ systemctl restart cobblerd
$ vim /etc/cobbler/settings
server
next_server
$ cobbler get-loaders
$ systemctl enable rsyncd
$ vim /etc/debmirror.conf
# @dists="sid";
# @arches="i386";
$ openssl passwd -1 -salt $(openssl rand -hex 4)
$ vim /etc/cobbler/settings
default_password_crypted
$ yum install cman fence-agents
$ vim /etc/xinetd.d/tftp
disabled=no
$ systemctl restart cobblerd
$ cobbler sync
$ cobbler check
$ yum install -y dhcp
$ vim /etc/dhcp/dhcpd.conf
option domain-name "chinasoft.com";
option domain-name-servers 114.114.114.114,8.8.8.8;
default-lease-time 43200;
max-lease-time 86400;
log-facility local7;
subnet 20.0.0.0 netmask 255.0.0.0 {
range 20.20.10.10 20.20.10.240;
option routers 20.20.20.20;
}
next-server 20.20.20.20;
filename="pxelinux.0";
$ systemctl restart dhcpd
$ systemctl enable tftp
$ systemctl enable dhcpd
$ systemctl start tftp
$ systemctl restart cobblerd
$ cobbler distro list
$ cobbler profile list
$ mount -r /dev/cdrom /media
$ cobbler import --name="centos7.1806" --path=/media
$ cobbler profile remove --name=centos7.1806
$ cp anaconda-ks.cfg /var/lib/cobbler/kickstarts/
$ cobbler profile add --name=centos7.1806 --distro=centos7.1806 --kickstart=/var/lib/cobbler/kickstarts/centos7.1806.cfg
$ cobbler sync
#Kickstart Configurator by WangYang
#platform=x86, AMD64, or Intel EM64T
#System language
lang en_US
#System keyboard
keyboard us
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $default_password_crypted
#rootpw --iscrypted $1$ops-node$7hqdpgEmIE7Z0RbtQkxW20
#Use text mode install
text
#Install OS instead of upgrade
install
#Use NFS installation Media
url --url="http://192.168.66.14/cobbler/ks_mirror/centos7" (須要修改路徑)
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype xfs --size 1024 --ondisk sda
part swap --size 4000 --ondisk sda
part / --fstype xfs --size 1 --grow --ondisk sda
#System authorization infomation
auth --useshadow --enablemd5
#Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Firewall configuration
firewall --disabled
#SELinux configuration
selinux --disabled
#Do not configure XWindows
skipx
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end
#Package install information
%packages 標紅看我的需求,不應也沒事
@^minimal
@core
chrony
kexec-tools
%end
$ mount -r /dev/cdrom /media
$ cobbler import --name="centos6.8" --path=/media
$ cobbler profile remove --name=centos6.8
$ cp anaconda-ks.cfg /var/lib/cobbler/kickstarts/
$ cobbler profile add --name=centos6.8 --distro=centos6.8 --kickstart=/var/lib/cobbler/kickstarts/centos6.8.cfg
$ cobbler sync
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
#Partition information
part /boot --fstype ext4 --size 1024 --ondisk sda
part swap --size=1500
part / --fstype ext4 --size 1 --grow --ondisk sda
# Use text mode install
text
# Firewall configuration
firewall --disable
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=em1
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
%packages
@base
@compat-libraries
@debugging
@development
tree
nmap
sysstat
lrzsz
dos2unix
telnet
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%post
%end
$ cobbler system add --name=default --profile=centos7-basic