- CentOS-Base.repo
- The mirror system uses the connecting IP address of the client and the
- update status of each mirror to pick mirrors that are updated to and
- geographically close to the client. You should use this for CentOS updates
- unless you are manually picking other mirrors.
- If the mirrorlist= does not work for you, as a fall back you can try the
- remarked out baseurl= line instead.
- http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os">mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
- released updates
- http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates">mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
- additional packages that may be useful
- http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras">mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
- additional packages that extend functionality of existing packages
- http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus">mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
- **
- Cobbler managed dhcpd.conf file
- generated from cobbler dhcp.conf template ($date)
- Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
- in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
- overwritten.
- **
- for dhcp_tag in $dhcp_tags.keys():
- group for Cobbler DHCP tag: $dhcp_tag
- end for
- Kickstart Configurator for cobbler by zhang
- platform=x86, AMD64, or Intel EM64T
- Firewall configuratio
- Install OS instead of upgrade
- Use network installation
- Root password
- System authorization information
- Use graphical mode install
- Run the Setup Agent on first boot
- System keyboard
- System timezone
- System language
- SELinux configuration
- Installation logging level
- System timezone
- Network information
- System bootloader configuration
- Partition clearing information
- Disk partitioning information
- Reboot after installation
- Clear the Master Boot Record
一、简介
二、安装配置
将Yum源改为国内源并安装EPEL源
删除/etc/yum.repos.d/目录下的所有文件,
rm -rf /etc/yum.repos.d/*
新建一个名为Centos-Base.repo的文件,文件内容如下 ```
CentOS-Base.repo
#
The mirror system uses the connecting IP address of the client and the
update status of each mirror to pick mirrors that are updated to and
geographically close to the client. You should use this for CentOS updates
unless you are manually picking other mirrors.
#
If the mirrorlist= does not work for you, as a fall back you can try the
remarked out baseurl= line instead.
# #
[base] name=CentOS-$releasever - Base baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
released updates
[updates] name=CentOS-$releasever - Updates baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
additional packages that may be useful
[extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
additional packages that extend functionality of existing packages
[centosplus] name=CentOS-$releasever - Plus baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
c. 清空并重新生成缓存
yum clean all yum makecache
d. 安装epel源
yum -y install httpd dhcp tftp cobbler cobbler-web pykickstart xinetd
systemctl start httpd<br />systemctl start cobblerd
systemctl start cobblerd<br />systemctl stop firewalld<br />setenforce 0<br />vi /etc/sysconfig/selinux <br />cobbler check
vi /etc/cobbler/settings<br />#修改278行和390行为本地的IP地址
vi /etc/xinetd.d/tftp<br />disable = no
cobbler get-loaders
openssl passwd -1 -salt 'cobbler' 'cobbler'
vi /etc/cobbler/settings<br />default_password_crypted: "$1$cobbler$M6SE55xZodWc9.vAKLJs6."<br />manage_dhcp: 1 #242行
vi /etc/cobbler/dhcp.template
**
Cobbler managed dhcpd.conf file
#
generated from cobbler dhcp.conf template ($date)
Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
overwritten.
#
**
ddns-update-style interim;
allow booting; allow bootp;
ignore client-updates; set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.152.0 netmask 255.255.255.0 { option routers 192.168.152.1; option domain-name-servers 192.168.152.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.152.101 192.168.152.250; default-lease-time 21600; max-lease-time 43200; next-server $next_server; class “pxeclients” { match if substring (option vendor-class-identifier, 0, 9) = “PXEClient”; if option pxe-system-type = 00:02 { filename “ia64/elilo.efi”; } else if option pxe-system-type = 00:06 { filename “grub/grub-x86.efi”; } else if option pxe-system-type = 00:07 { filename “grub/grub-x86_64.efi”; } else if option pxe-system-type = 00:09 { filename “grub/grub-x86_64.efi”; } else { filename “pxelinux.0”; } }
}
for dhcp_tag in $dhcp_tags.keys():
## group could be subnet if your dhcp tags line up with your subnets
## or really any valid dhcpd.conf construct ... if you only use the
## default dhcp tag in cobbler, the group block can be deleted for a
## flat configuration
group for Cobbler DHCP tag: $dhcp_tag
group {
#for mac in $dhcp_tags[$dhcp_tag].keys():
#set iface = $dhcp_tags[$dhcp_tag][$mac]
host $iface.name {
#if $iface.interface_type == "infiniband":
option dhcp-client-identifier = $mac;
#else
hardware ethernet $mac;
#end if
#if $iface.ip_address:
fixed-address $iface.ip_address;
#end if
#if $iface.hostname:
option host-name "$iface.hostname";
#end if
#if $iface.netmask:
option subnet-mask $iface.netmask;
#end if
#if $iface.gateway:
option routers $iface.gateway;
#end if
#if $iface.enable_gpxe:
if exists user-class and option user-class = "gPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else if exists user-class and option user-class = "iPXE" {
filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
} else {
filename "undionly.kpxe";
}
#else
filename "$iface.filename";
#end if
## Cobbler defaults to $next_server, but some users
## may like to use $iface.system.server for proxied setups
next-server $next_server;
## next-server $iface.next_server;
}
#end for
}
end for
cobbler sync
mount /dev/cdrom /mnt<br />cobbler import --path=/mnt --name=Centos-7.5-x86_64 --arch=x86_64
vi /var/lib/cobbler/kickstarts/centos7.3-x86_64.cfg
Kickstart Configurator for cobbler by zhang
platform=x86, AMD64, or Intel EM64T
Firewall configuratio
firewall —disabled
Install OS instead of upgrade
install
Use network installation
url —url=http://192.168.152.100/cobbler/ks_mirror/Centos-7.5-x86_64
Root password
rootpw root
System authorization information
auth —useshadow—enablemd5
Use graphical mode install
graphical
Run the Setup Agent on first boot
firstboot —disable
System keyboard
keyboard us
System timezone
timezone Asia/Shanghai
System language
lang en_US
SELinux configuration
selinux —disabled
Installation logging level
logging —level=info
System timezone
timezone Asia/Shanghai
Network information
network —bootproto=dhcp —device=eth0 —onboot=on
System bootloader configuration
bootloader —location=mbr
Partition clearing information
clearpart —all —initlabel
Disk partitioning information
part /boot —fstype xfs —size 1024 —ondisk sda part swap —size=2048 —ondisk sda part / —fstype xfs —size 1 —grow —ondisk sda
Reboot after installation
reboot
Clear the Master Boot Record
zerombr
%packages gcc* sysstat lrzsz %end
```
cobbler profile edit —name=Centos-7.5-x86_64 —kickstart=/var/lib/cobbler/kickstarts/centos7.3-x86_64.cfg
cobbler profile edit —name=Centos-7.5-x86_64 —kopts=’net.ifnames=0 biosdevname=0’
cobbler sync
systemctl restart xinetd
systemctl restart httpd
systemctl restart cobblerd
systemctl enable xinetd
systemctl enable dhcpd
systemctl enable httpd
systemctl enable cobblerd
systemctl disable firewalld
setenforce 0
systemctl start xinetd httpd dhcpd cobblerd
vim /etc/cobbler/pxe/pxedefault.template # cobbler默认启动菜单路径