R&D/클라우드

[CentOS 7] Kick Start

sunshout 2015. 1. 5. 15:55

# Kickstart file automatically generated by anaconda.


#version=DEVEL

install

url --url=http://ftp.daum.net/centos/7/os/x86_64/

lang en_US.UTF-8

keyboard us

network --onboot yes --device enp0s20f0 --bootproto dhcp --noipv6

network --onboot yes --device enp4s0f1 --bootproto dhcp --noipv6

rootpw  --iscrypted $6$ky2rmsUpWeGJtHrl$fFhWPBijM0Ue3Mk2naotBqymrzMYqH8FXyhH6UbXko3kWP9Vkq1lcEdiCWvUISbRsS3WqT1MD3dokWYppEFlQ/

firewall --service=ssh

authconfig --enableshadow --passalgo=sha512

selinux --disabled

timezone --utc Asia/Seoul

bootloader --location=mbr --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 --initlabel

zerombr

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

part pv.008002 --grow --size=1

volgroup vg_system --pesize=4096 pv.008002

#logvol /home --fstype=ext4 --name=lv_home --vgname=vg_system --grow --size=100

logvol / --fstype=ext4 --name=lv_root --vgname=vg_system --grow --size=1024 --maxsize=512000

logvol swap --name=lv_swap --vgname=vg_system --grow --size=16120 --maxsize=16120


repo --name="CentOS"  --baseurl=http://ftp.daum.net/centos/7/os/x86_64/ --cost=100


reboot


%packages

@base

@console-internet

@core

@debugging

@directory-client

@hardware-monitoring

@java-platform

@large-systems

@network-file-system-client

@performance

@perl-runtime

pax

oddjob

sgpio

device-mapper-persistent-data

samba-winbind

certmonger

pam_krb5

krb5-workstation

perl-DBD-SQLite

%end



여러 옵션들

rootpw (required)
Sets the system's root password to the password argument.
rootpw [--iscrypted|--plaintext] [--lock] password
  • --iscrypted - If this option is present, the password argument is assumed to already be encrypted. This option is mutually exclusive with --plaintext. To create an encrypted password, you can use python:
    $ python -c 'import crypt; print(crypt.crypt("My Password"))'

Password 암호화

https://thornelabs.net/2014/02/03/hash-roots-password-in-rhel-and-centos-kickstart-profiles.html


Post script


%post --logfile /root/ks-post.log

cat >/etc/yum.repos.d/rhel-debuginfo.repo <<EOF

[base]

name=CentOS-\$releasever - Base

baseurl=http://mirror.centos.org/centos/6/os/\$basearch/

gpgcheck=0


#released updates

[update]

name=CentOS-\$releasever - Updates

baseurl=http://mirror.centos.org/centos/6/updates/\$basearch/

gpgcheck=0

EOF

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum install -y salt-minion

%end