-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add autoinstall support for Fedora Workstation (#612)
Signed-off-by: linhuali <lli@vmware.com>
- Loading branch information
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Applicable to Fedora Workstation autoinstall with Fedora-Everything-netinst-.*.iso | ||
# version=DEVEL | ||
# Use graphical install | ||
graphical | ||
repo --name=fedora --metalink="https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch" | ||
repo --name=updates --metalink="https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch" | ||
|
||
# Keyboard layouts | ||
keyboard --vckeymap=us --xlayouts='us' | ||
|
||
# System language | ||
lang en_US.UTF-8 | ||
|
||
# Use network installation | ||
url --metalink="https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch" | ||
|
||
%packages | ||
@^workstation-product-environment | ||
@base-x | ||
open-vm-tools-desktop | ||
%end | ||
|
||
# License agreement | ||
eula --agreed | ||
|
||
# X Window System configuration information | ||
xconfig --startxonboot | ||
# Do not run the Setup Agent on first boot | ||
firstboot --disable | ||
|
||
# Generated using Blivet version 3.5.0 | ||
ignoredisk --only-use={{ boot_disk_name }} | ||
autopart | ||
# Partition clearing information | ||
clearpart --none --initlabel | ||
|
||
# System services | ||
services --enabled="chronyd,sshd" | ||
|
||
# System timezone | ||
timezone America/New_York --utc | ||
|
||
# Network | ||
network --bootproto=dhcp --ipv6=auto --activate | ||
network --hostname=localhost.localdomain | ||
|
||
# Firewall configuration | ||
firewall --disabled | ||
|
||
#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 %} | ||
|
||
# Shutdown when the install is finished. | ||
shutdown | ||
|
||
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters