2020-09-16 21:45:30 +00:00
|
|
|
# This is a basic Fedora cloud spin designed to work with GCP.
|
|
|
|
# Note that GCP prefers UEFI so we'll need to make sure this image
|
|
|
|
# is created from a machine that is started in UEFI mode.
|
|
|
|
|
|
|
|
# Inherit from cloud base
|
|
|
|
%include fedora-cloud-base.ks
|
|
|
|
|
|
|
|
# Change serial port configuration to recommended default for GCP (ttyS0,38400n8d)
|
|
|
|
# Don't show bootloader as it's impossible for the user to get to it in time
|
|
|
|
# So we might as well not waste the 1 second on each boot.
|
|
|
|
# https://cloud.google.com/compute/docs/import/import-existing-image
|
2024-04-15 12:54:30 +00:00
|
|
|
bootloader --timeout=0 --location=mbr --append="no_timer_check console=ttyS0,38400n8d"
|
2020-09-16 21:45:30 +00:00
|
|
|
|
2021-05-06 18:49:46 +00:00
|
|
|
# redefine `services` here to drop cloud-init systemd unit enablements from
|
|
|
|
# fedora-cloud-base.ks since we don't use them.
|
|
|
|
services --enabled=sshd
|
|
|
|
|
2020-12-23 15:41:39 +00:00
|
|
|
%packages
|
2021-05-06 18:49:46 +00:00
|
|
|
# GCP provides its own guest environment.
|
2021-05-10 21:29:17 +00:00
|
|
|
google-compute-engine-guest-configs
|
2023-05-18 14:34:20 +00:00
|
|
|
# BZ 2193039: Ensure additional packages are present for ssh access management
|
2023-05-17 13:21:58 +00:00
|
|
|
google-compute-engine-oslogin
|
2023-05-18 14:34:20 +00:00
|
|
|
google-guest-agent
|
2021-05-06 18:49:46 +00:00
|
|
|
-cloud-init
|
2020-12-22 01:46:33 +00:00
|
|
|
# Fedora Cloud Base includes the qemu guest agent. GCP prefers
|
|
|
|
# that it not be installed https://pagure.io/cloud-sig/issue/319
|
|
|
|
-qemu-guest-agent
|
2020-12-23 15:41:39 +00:00
|
|
|
%end
|
2020-09-16 21:45:30 +00:00
|
|
|
|
|
|
|
%post --erroronfail
|
|
|
|
cat <<EOF > /etc/NetworkManager/conf.d/gcp-mtu.conf
|
|
|
|
# In GCP it is recommended to use 1460 as the MTU.
|
|
|
|
# Set it to 1460 for all connections.
|
|
|
|
# https://cloud.google.com/network-connectivity/docs/vpn/concepts/mtu-considerations
|
|
|
|
[connection]
|
|
|
|
ethernet.mtu = 1460
|
|
|
|
EOF
|
|
|
|
%end
|