-
Notifications
You must be signed in to change notification settings - Fork 29
/
ks.cfg
90 lines (77 loc) · 2.41 KB
/
ks.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#version=RHEL8
ignoredisk --only-use={{ boot_disk_name }}
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
# Use graphical install
graphical
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
# Use CDROM installation media
cdrom
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# License agreement
eula --agreed
# Network information
network --bootproto=dhcp --ipv6=auto
network --hostname=localhost.localdomain
# Root password
rootpw --iscrypted {{ vm_password_hash }}
# Add SSH key
sshkey --username=root "{{ ssh_public_key }}"
{% if new_user is defined and new_user != 'root' %}
user --name={{ new_user }} --password={{ vm_password_hash }} --groups=root,wheel --iscrypted --gecos="{{ new_user }}"
sshkey --username={{ new_user }} "{{ ssh_public_key }}"
{% endif %}
# X Window System configuration information
xconfig --startxonboot
# Do not run gnome-initial-setupgnome-initial-setup on first boot
firstboot --disable
# System services
services --enabled="chronyd"
services --disabled="firewalld"
# System timezone
timezone America/New_York --isUtc
# Shutdown when the install is finished.
shutdown
%packages
@^graphical-server-environment
kexec-tools
open-vm-tools-desktop
cloud-init
java-1.8.0-openjdk-headless
java-1.8.0-openjdk
ndctl
iproute
rdma-core
librdmacm-utils
libibverbs
libibverbs-utils
infiniband-diags
perftest
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post --interpreter=/usr/bin/bash --log=/root/ks-post.log
if [ -f /etc/cloud/cloud.cfg ]; then
sed -i 's/^disable_root:.*/disable_root: false/' /etc/cloud/cloud.cfg
sed -i 's/^ssh_pwauth:.*/ssh_pwauth: yes/' /etc/cloud/cloud.cfg
fi
# Permit root login via SSH
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
{% if new_user is defined and new_user != 'root' %}
# Add new user to sudoer
echo '{{ new_user }} ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/{{ new_user }}
# Enable autologin
sed -i '/\[daemon\]/a AutomaticLogin={{ new_user }}' /etc/gdm/custom.conf
sed -i '/\[daemon\]/a AutomaticLoginEnable=True' /etc/gdm/custom.conf
{% endif %}
echo '{{ autoinstall_complete_msg }}' >/dev/ttyS0
%end