运维学习之自动化安装系统的配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了运维学习之自动化安装系统的配置相关的知识,希望对你有一定的参考价值。

packags needed

need packages:

system-config-kickstart ##自动应答脚本制作工具

syslinux ##获得pxelinux.0文件安装包

dhcp ##分配ip给客户机的服务

tftp-server ##提供tftp协议的服务

httpd ##安装源共享服务

技术分享

技术分享

技术分享

技术分享

技术分享

#########################config file rules#####################################

No.1 FIST CONFIG DHCP ##配置dhcp配置文件

config /etc/dhcpd/dhcpd.conf like this:

===============================================================

option domain-name "example.com"; ##域名

option domain-name-servers 192.168.0.79; ##dns

default-lease-time 600; ##默认租约期

max-lease-time 7200; ##最长租约期

log-facility local7; ##日志级别

subnet 192.168.0.0 netmask 255.255.255.0 { ##网段,子网掩码

  range 192.168.0.102 192.168.0.111; ##地址范围

  option routers 192.168.0.254; ##网关

  filename "pxelinux.0"; ##pxe启动程序

  next-server 192.168.0.79; ##tftp主机地址

}

技术分享

技术分享

技术分享

systemctl restart dhcpd

systemctl stop firewalld


No.2 SED CONFIG TFTP

config /etc/xinetd.d/tftp like this:

service tftp

{

        socket_type        = dgram

        protocol              = udp

        wait                     = yes

        user                    = root

        server                 = /usr/sbin/in.tftpd

        server_args        = -s /var/lib/tftpboot

        disable                = <<<<<<<<<yes--->no>>>>>>

        per_source         = 11

        cps                     = 100 2

        flags                   = IPv4

}

技术分享

systemctl restart xinetd

技术分享

技术分享

virt_install.sh

技术分享

No.3 TRD MAKE SOME FILES AND PXEWORKDIRECTORY

1)

cd /var/lib/tftpboot/

mkdir pxelinux.cfg

2)

mount the iso of the rhel7

cp isolinux/* /var/lib/tftpboot


3)

cp /var/lib/tftpboot/isolinux.cfg   /var/lib/tftpboot/pxelinux.cfg/default

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

技术分享

技术分享

技术分享

技术分享

所执行过的操作

技术分享

4)

make a userfully install source and kickstart,my of this is in the ftp‘s pub

ftp://192.168.0.252/pub/rhel6

ftp://192.168.0.252/pub/ks.cfg

5)

config the file of /var/lib/tftpboot/pxelinux.cfg/default like this:

========================================================================================

default vesamenu.c32

timeout 600 ##等待时间


display boot.msg


# Clear the screen when exiting the menu, instead of leaving the menu displayed.

# For vesamenu, this means the graphical background is still displayed without

# the menu itself for as long as the screen remains in graphics mode.

menu clear

menu background splash.png

menu title Red Hat Enterprise Linux 7.0 ##大标题

menu vshift 8

menu rows 18

menu margin 8

#menu hidden

menu helpmsgrow 15

menu tabmsgrow 13


# Border Area

menu color border * #00000000 #00000000 none


# Selected item

menu color sel 0 #ffffffff #00000000 none


# Title bar

menu color title 0 #ff7ba3d0 #00000000 none


# Press [Tab] message

menu color tabmsg 0 #ff3a6496 #00000000 none


# Unselected menu item

menu color unsel 0 #84b8ffff #00000000 none


# Selected hotkey

menu color hotsel 0 #84b8ffff #00000000 none


# Unselected hotkey

menu color hotkey 0 #ffffffff #00000000 none


# Help text

menu color help 0 #ffffffff #00000000 none


# A scrollbar of some type? Not sure.

menu color scrollbar 0 #ffffffff #ff355594 none


# Timeout msg

menu color timeout 0 #ffffffff #00000000 none

menu color timeout_msg 0 #ffffffff #00000000 none


# Command prompt text

menu color cmdmark 0 #84b8ffff #00000000 none

menu color cmdline 0 #ffffffff #00000000 none


# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.


menu tabmsg Press Tab for full configuration options on menu items.


menu separator # insert an empty line

menu separator # insert an empty line


label linux

  menu label ^Install Red Hat Enterprise Linux 7.0 ##小标题

   menu default ##默认标题设定

  kernel vmlinuz

  append initrd=initrd.img repo=http://172.25.254.100/soucre ks=http://172.25.254.100/ks.cfg ##安装源和ks

技术分享

label check

  menu label Test this ^media & install Red Hat Enterprise Linux 7.0

  #menu default

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rd.live.check quiet

图形界面配置ks.cfg

技术分享

技术分享

技术分享

技术分享

最后安装界面的样式

技术分享


以上是关于运维学习之自动化安装系统的配置的主要内容,如果未能解决你的问题,请参考以下文章

Linux运维学习之cobbler自动安装系统

Ansible自动化运维学习之五:Ansible配置文件详解与调优

运维学习之软件的安装和管理

运维学习之系统虚拟机管理

Linux云计算运维学习之Expect概念

运维学习之nfs系统文件服务