Help us understand the problem. What is going on with this article?

RHEL 7でkickstart

More than 3 years have passed since last update.

VirtualboxにRHEL 7を自動インストールする為にkickstartを使ってみました。
yumによるインストールの例でDockerを入れています。
YOUR_USERNAMECLEAR_TEXT_PASSWORDは自分のRed Hatのサブスクリプションに合わせて修正して下さい。

このファイルをhttpでアクセス出来る場所に置いてRHELのCD ROMを入れて立ち上げた起動画面でTABキーを押し、最後にks=http://192.168.0.5:8000/anaconda-ks.cfgのように定義ファイルを指定します。
kickstart.jpg

anaconda-ks.cfg
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=jp --xlayouts='jp'
# System language
lang ja_JP.UTF-8

# Network information
network  --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate
network  --hostname=rhel7

# Root password is PASSWORD
rootpw --iscrypted $6$37a5ec68c43d0522$8lqJNDajgg362q9pBFWWWztFLELotDEbwTaRjX3Zvz37Hq/2VViawgl0IZxSFTQdJ9y7sUUY8cXjt.ZBS834m/
# System timezone
timezone Asia/Tokyo --isUtc
# password is PASSWORD
user --groups=wheel --name=rhel7 --password=$6$a58429ffe28bf988$aB52XqWFRhmXf2LGkDFVujcgZjGZr44cuGoCv1OEF2Ou2Iw7R7E7Ip8FDNRmQxjNS.cBCh/uSDB1pJl1kzu9T/ --iscrypted --gecos="Red Hat"
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=sda

%packages
@^minimal
@core
kexec-tools

%end

%post --log=/root/registration_results.out
subscription-manager register --auto-attach --username=YOUR_USERNAME --password=CLEAR_TEXT_PASSWORD

subscription-manager repos --enable=rhel-7-server-extras-rpms
subscription-manager repos --enable=rhel-7-server-optional-rpms
# Docker
yum install -y docker docker-registry
yum install -y device-mapper-libs device-mapper-event-libs
systemctl start docker.service
systemctl enable docker.service

%end

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

%end

# Reboot after installation
reboot --eject

ハッシュされたパスワードの設定

  • Macの場合
    php -r 'echo crypt("PASSWORD","$6$".sha1(uniqid(mt_rand(),true))), PHP_EOL;'

  • RHELの場合
    python -c 'import crypt, random, hashlib; random.seed(); print crypt.crypt("PASSWORD", "$6$" + hashlib.sha1(str(random.random())).hexdigest())';

  • RHEL7の場合、こっちの方が簡単でした
    grub2-mkpasswd-pbkdf2

参考

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away