Skip to content

Instantly share code, notes, and snippets.

@lorentzca
Created December 1, 2015 03:17
Show Gist options
  • Save lorentzca/6ef68a4eeb0b37bd1a3e to your computer and use it in GitHub Desktop.
Save lorentzca/6ef68a4eeb0b37bd1a3e to your computer and use it in GitHub Desktop.
centos kickstart config file
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard jp106
network --onboot yes --device eth0 --bootproto dhcp --noipv6
network --onboot no --device eth1 --bootproto dhcp --noipv6
rootpw --iscrypted <暗号化されたパスワード>
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --permissive
timezone --utc Asia/Tokyo
bootloader --location=partition --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all
zerombr
part /boot/efi --fstype=efi --size=128
part /boot --fstype=ext4 --size=128
part /usr --fstype=ext4 --size=10240
part /home --fstype=ext4 --size=4096
part swap --size=2048
part /tmp --fstype=ext4 --size=2048
part / --fstype=ext4 --size=1024
part /var --fstype=ext4 --grow --size=200
repo --name="CentOS" --baseurl=file:///mnt/source --cost=100
%packages --nobase
@core
%end
%post
yum update -y
yum groupinstall -y base
ifconfig | sendmail <メールアドレス>
%end
@lorentzca
Copy link
Author

実行方法

  • このファイルを適当に修正してgistとかに貼っとく
  • grubシェルでinstallの行を選択してeキー
  • kernelから始まる行を選択してeキー
  • kernel /images/pxeboot/vmlinuz nomodeset askmethodみたいな部分を以下のように修正
kernel /images/pxeboot/vmlinuz ks=http://設定ファイルを置いたgistとか
  • Enterで保存
  • bキーでブート
  • osインストールが設定ファイルに従い自動で走る
  • インストール終了後にifconfigの結果をメールで飛ばしてます

参考リンク

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment