forked from ofalk/azure-rhel7-gen2-vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kickstart.cfg
61 lines (52 loc) · 1.72 KB
/
kickstart.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
lang en_US
keyboard us
network --bootproto=dhcp
timezone Europe/Zurich --isUtc
rootpw $1$UXuLNNvG$VoUMFsaF/tCpey2cFg7qK. --iscrypted
poweroff
bootloader --append="crashkernel=auto console=ttyS0 console=tty0"
zerombr
clearpart --all --initlabel
autopart
text
auth --passalgo=sha512 --useshadow
selinux --enforcing
firewall --enabled --ssh
skipx
firstboot --disable
%packages
gdisk
python2-pyasn1
net-tools
cloud-utils-growpart
%end
%post --nochroot --log=/mnt/sysimage/root/ks-post.log
cat <<EOF > /mnt/sysimage/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
EOF
cat <<EOF > /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=no
EOF
sed -i s/^.*swap.*swap.*$// /mnt/sysimage/etc/fstab
rpm -ivh --root /mnt/sysimage http://mirror.centos.org/centos/7/extras/x86_64/Packages/WALinuxAgent-2.2.38-2.el7_7.noarch.rpm --nosignature
sed -i 's/# AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' /mnt/sysimage/etc/waagent.conf
sed -i 's/ResourceDisk.EnableSwap=n/ResourceDisk.EnableSwap=y/g' /mnt/sysimage/etc/waagent.conf
sed -i 's/ResourceDisk.SwapSizeMB=0/ResourceDisk.SwapSizeMB=2048/g' /mnt/sysimage/etc/waagent.conf
echo 'add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "'>> /mnt/sysimage/etc/dracut.conf
chroot /mnt/sysimage dracut -f -v
chroot /mnt/sysimage chkconfig waagent on
echo -n "Getty fixes"
# although we want console output going to the serial console, we don't
# actually have the opportunity to login there. FIX.
# we don't really need to auto-spawn _any_ gettys.
sed -i 's/^#NAutoVTs=.*/NAutoVTs=0/' /mnt/sysimage/etc/systemd/logind.conf
sed -i 's/^#ReserveVT=.*/ReserveVT=0/' /mnt/sysimage/etc/systemd/logind.conf
%end