Ansible playbook to automate setting up a Fedora workstation from scratch.
fedora-init/
├── ansible.cfg
├── hosts.yaml
├── fedora_init.yaml # main playbook — system-level setup and entry point
└── tasks/
├── codecs.yaml # ffmpeg swap and multimedia codec group
├── nvidia.yaml # NVIDIA drivers, services, and nvtop
├── packages.yaml # dnf packages, flatpaks (minimal + extras)
├── vscode.yaml # Visual Studio Code
├── brave.yaml # Brave Origin browser
├── fonts.yaml # Microsoft Core Fonts
├── gnome-extensions.yaml # GNOME shell extensions via gext
└── development.yaml # build deps, pyenv, uv, Docker, kubectl, kind
The main playbook handles foundational system setup that everything else depends on:
- Installs
dnf-plugins-core(required by both Brave and Docker repo setup) - Detects the Fedora version and whether an NVIDIA GPU is present
- Enables RPM Fusion (free + nonfree) repositories
- Delegates all other setup to task files via
ansible.builtin.import_tasks - Defines the
Restart Dockerhandler used by the NVIDIA container toolkit configuration
- Swaps
ffmpeg-freeforffmpeg(skipped if already swapped) - Updates the multimedia codec group
All NVIDIA-related setup, skipped automatically on non-NVIDIA systems:
- Installs NVIDIA drivers (
akmod-nvidia, CUDA, power management, VA-API codec) - Installs
nvtopfor GPU monitoring - Enables
nvidia-suspend,nvidia-resume, andnvidia-hibernatesystemd services
General application installs and removals:
- Installs
gnome-tweaks,ffmpegthumbnailer,vlc,libreoffice-writer,libreoffice-calc - Removes unwanted GNOME apps (tour, contacts, maps, weather, help, and others)
- Adds Flathub and installs a minimal set of flatpak apps: Spotify, Flatseal, GNOME Extensions
- Installs extra flatpak apps tagged
extras(skippable for a leaner setup): GIMP, Tiny Wii Backup Manager, PCSX2, Czkawka
- Adds the Microsoft GPG key and yum repository
- Installs Visual Studio Code
- Adds the Brave Beta yum repository
- Installs Brave Origin browser
- Installs font tooling dependencies (
curl,cabextract,xorg-x11-font-utils,mkfontscale,fontconfig,cpio,unzip) - Downloads the
msttcore-fonts-installerRPM from SourceForge and verifies its SHA256 checksum - Installs the RPM with
--nodigest --nofiledigest(required because this 2013 community package lacks the digest metadata DNF5 expects); skipped if already installed
Installs GNOME shell extensions via gext install:
dash-to-dock@micxgx.gmail.comrandomwallpaper@iflow.spaceblur-my-shell@aunetxaccent-directories@taiwbi.com
Note:
gext installalso attempts to enable extensions, which requires a running GNOME session. If run before first login, install succeeds but enabling may fail silently. Re-run or enable manually withgext enable <uuid>after logging in.
Developer toolchain setup:
- Installs C/Python build dependencies (
gcc,make,*-develpackages, etc.) - Installs pyenv (skipped if already installed), runs
pyenv update, and configures it in.bashrcand.bash_profile - Installs uv and configures shell completion
- Installs Docker CE and (if NVIDIA detected) the NVIDIA Container Toolkit
- Configures the NVIDIA runtime for Docker and triggers a Docker restart via handler
- Adds the current user to the
dockergroup - Adds the Kubernetes package repository and installs
kubectl(with bash completion) - Installs kind from the upstream release binary into
/usr/local/bin(the Fedorakindpackage requiresdocker-cli, whichdocker-ce-clidoes not provide)
Two tags allow trimming the install for a leaner setup:
extras— optional flatpak apps intasks/packages.yaml(GIMP, Tiny Wii Backup Manager, PCSX2, Czkawka)development— everything intasks/development.yamlandtasks/vscode.yaml(build deps, pyenv, uv, Docker, kubectl, kind, VS Code)
Skip either or both with --skip-tags:
ansible-playbook fedora_init.yaml --skip-tags extras --ask-become-pass
ansible-playbook fedora_init.yaml --skip-tags extras,development --ask-become-pass
sudo dnf -y update
sudo dnf install ansible -y
ansible-galaxy collection install community.general
Then reboot before running the playbook so the updated kernel is active.
[!CAUTION] DO NOT RUN AS ROOT
ansible-playbook fedora_init.yaml --ask-become-pass
Reboot after the playbook completes (required for NVIDIA drivers and group membership changes to take effect).