收藏文章 楼主

linux ipmi 远程配置脚本

版块:linux   类型:普通   作者:小绿叶技术博客   查看:544   回复:0   获赞:12   时间:2020-07-03 10:33:09

anaconda-ks.cfg  original-ks.cfg

[root@w251704 ~]# cat anaconda-ks.cfg 

#platform=86, AMD64, or Intel EM64T

#version=DEVEL

# System authorization information

auth --useshadow  --passalgo=sha512

# Install OS instead of upgrade

install

# Use network installation

url --url="http://x.x.x.x

# Use text mode install

text

# Firewall configuration

firewall --enabled --service=ssh

firstboot --disable

ignoredisk --only-use=sda

# Keyboard layouts

# old format: keyboard us

# new format:

keyboard --vckeymap=us --xlayouts=''

# System language

lang en_US.UTF-8

# Network information

network  --bootproto=static --device=$(mac) --gateway=x.x.x.x --hostname=w251704 --ip=x.x.x.x --nameserver=8.8.8.8 --netmask=255.255.255.0 --activate

# Reboot after installation

reboot

# Root password

rootpw --iscrypted $1$zjmf$OeqCqvbpdLHCxeOOcuv9W/

# SELinux configuration

selinux --disabled

# System services

services --enabled="chronyd"

# Do not configure the X Window System

skipx

# System timezone

timezone Asia/Shanghai

# System bootloader configuration

bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all --initlabel

# Disk partitioning information

part /boot --fstype="ext3" --size=500

part swap --fstype="swap" --size=8192

part / --fstype="ext4" --size=220243

%pre

curl http://x.x.x.x

curl -o /tmp/get_hardware_info.sh http://x.x.x.x

bash /tmp/get_hardware_info.sh > /dev/null 2>&1 < /dev/null &

curl -o /tmp/upload_log.sh http://x.x.x.x

bash /tmp/upload_log.sh > /dev/null 2>&1 < /dev/null &

%end

%post

sed -i "s/dnssec-validation yes/dnssec-validation no/" /etc/named.conf

echo SELINUX=disabled > /etc/selinux/config

yum clean all

sed -i "s/quiet/ipmi_si.tryacpi=0 ipmi_si.trydmi=0 ipmi_si.trydefaults=0 quiet/g" /boot/grub2/grub.cfg

systemctl stop NetworkManager

systemctl disable NetworkManager

reboot

sed -i "s/.*Port .*/Port 22/g" /etc/ssh/sshd_config

sed -i 's/port=".*"/port="22"/' /usr/lib/firewalld/services/ssh.xml

curl "http://x.x.x.x

curl -s http://x.x.x.x

curl "http://x.x.x.x

curl -s "http://x.x.x.x

%end

%packages --nobase

chrony

kexec-tools

%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

[root@w251704 ~]# cat  original-ks.cfg

#platform=x86, AMD64, or Intel EM64T

#version=DEVEL

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard 'us'

#Root password

rootpw --iscrypted $1$zjmf$OeqCqvbpdLHCxeOOcuv9W/

# System timezone

timezone Asia/Shanghai

# System language

lang en_US

# Firewall configuration

firewall --enabled --ssh

# System authorization information

auth  --useshadow  --passalgo=sha512

# Use network installation

url --url=http://x.x.x.x

# Use text install

text

firstboot --disable

# SELinux configuration

selinux --disabled

# System bootloader configuration

# bootloader --location=mbr

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all --initlabel

# Allow anaconda to partition the system as needed

part /boot --fstype=ext3 --size=500

part swap --fstype=swap --size=8192

part / --fstype=ext4 --size=100 --grow

# Network information

network --bootproto=static --ip=x.x.x.x --netmask=255.255.255.0 --gateway=x.x.x.254--nameserver=8.8.8.8 --hostname=w251704

# Reboot after installation

reboot

%pre

curl http://x.x.x.x

curl -o /tmp/get_hardware_info.sh http://x.x.x.x

bash /tmp/get_hardware_info.sh > /dev/null 2>&1 < /dev/null &

curl -o /tmp/upload_log.sh http://x.x.x.x

bash /tmp/upload_log.sh > /dev/null 2>&1 < /dev/null &

%end

%packages --nobase

%end

%post

sed -i "s/dnssec-validation yes/dnssec-validation no/" /etc/named.conf

echo SELINUX=disabled > /etc/selinux/config

yum clean all

sed -i "s/quiet/ipmi_si.tryacpi=0 ipmi_si.trydmi=0 ipmi_si.trydefaults=0 quiet/g" /boot/grub2/grub.cfg

systemctl stop NetworkManager

systemctl disable NetworkManager

reboot

sed -i "s/.*Port .*/Port 22/g" /etc/ssh/sshd_config

sed -i 's/port=".*"/port="22"/' /usr/lib/firewalld/services/ssh.xml

curl "http://x.x.x.x

curl -s http://x.x.x.x

curl "http://x.x.x.x

curl -s "http://x.x.x.x

%end


提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:linux ipmi 远程配置脚本

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息