forked from avtar/packer-fedora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfedora28-kickstart.cfg
108 lines (90 loc) · 3.19 KB
/
fedora28-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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Fedora 28 kickstart file - ks.cfg
#
# For more information on kickstart syntax and commands, refer to the
# Fedora Installation Guide:
# http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/s1-kickstart2-options.html
#
# For testing, you can fire up a local http server temporarily.
# cd to the directory where this ks.cfg file resides and run the following:
# $ python -m SimpleHTTPServer
# You don't have to restart the server every time you make changes. Python
# will reload the file from disk every time. As long as you save your changes
# they will be reflected in the next HTTP download. Then to test with
# a PXE boot server, enter the following on the PXE boot prompt:
# > linux text ks=http://<your_ip>:8000/ks.cfg
# Required settings
lang en_US.UTF-8
keyboard 'us'
rootpw vagrant
auth --enableshadow --passalgo=sha512
timezone UTC
user --name=vagrant --homedir=/home/vagrant --password=vagrant
# For missing packages
url --url=https://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
repo --name=everything --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
# Optional settings
install
#cdrom
network --bootproto=dhcp
selinux --disabled
firewall --disabled
# Avoiding warning message on Storage device breaking automated generation
zerombr
# 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
services --enabled sshd
autopart
reboot
%packages --excludedocs
@core
@base-x
@fonts
@multimedia
@hardware-support
@workstation-product
@gnome-desktop
%end
%post
# Set systemlctl default target to graphical
systemctl set-default graphical.target
# Set up Ansible so it can be used to provision the VM locally
sed -i 's/^transport.*/transport = local/g' /etc/ansible/ansible.cfg
sed -i 's/^#host_key_checking.*$/host_key_checking\ \=\ False/g' /etc/ansible/ansible.cfg
cat <<-EOF > /etc/ansible/hosts
[local]
localhost
EOF
# Give Vagrant user permission to sudo.
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant
echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant
chmod 440 /etc/sudoers.d/vagrant
# Allow the vagrant user to autologin and also disable Wayland
# https://www.maketecheasier.com/fix-wayland-gdm-issue-fedora/
cat <<-EOF > /etc/gdm/custom.conf
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=vagrant
WaylandEnable=false
EOF
# Disable gnome-initial-setup
mkdir /home/vagrant/.config
touch /home/vagrant/.config/gnome-initial-setup-done
# Disable screensaver
mkdir -p /home/vagrant/.config/autostart
cat <<-EOF > /home/vagrant/.config/autostart/disable-screensaver.desktop
[Desktop Entry]
Type=Application
Name=DisableScreensaver
Comment=Disable screensaver
Exec=gsettings set org.gnome.desktop.session idle-delay 0
Terminal=false
NoDisplay=true
X-GNOME-Autostart-enabled=true
EOF
# Fix ownership of all files in /home/vagrant
chown -R vagrant:vagrant /home/vagrant /home/vagrant/.[^.]*
%end