Automate or script a Fedora Silverblue install : with kickstart files or other ways

I would like to automate the installation of Fedora SIlverblue. For now I have to do all those steps:

  • Get the Silverblue image: Team Silverblue — Download
  • install the Silverblue image on a USB installation disk
  • Boot the USB installation disk
  • Configure with GUI Anaconda the desired Fedora Silverblue installation settings
  • MOST IMPORTANTLY: setup partitioning to separate /home from other system partitions (/boot and the ostree partition)
  • Install and reboot Fedora Silverblue
  • Do post -install work in GUI (user accounts, connectivity, timezone, etc…)
  • Do post installation of programs from flatpak (via flathub or Gnome Software)
  • Do several installation and reboot for programs that aren’t distributed with flatpak but need install from rpm (via rpm-ostree and layering)

Is it possible to do any or all those steps in an automated or scripted way to install Fedora Silverblue ? So that I can duplicate and deploy those settings to several computers ?

Are there some ready to use kickstart files that may be customized , and how to use them for a Fedora Silverblue install ?

2 Likes

Hello @mahdiaqallal ,
Welcome to the :fedora: discussion area. I think there are kickstart examples for Workstation but I haven’t seen one for Silverblue, not to say someone hasn’t done that. One way you could go is to try Fedora Core OS since it uses ignition files to do everything from partitioning to installing SW to setting up the user. You could think of it as Silverblue Server. If there was such a thing.

1 Like

Thanks @jakfrost for your reply.
Could you please expand your answer because I didn’t finde any documentation stating ignition files could be used in Silverblue…

Dear Silverblue community I really need you contribution on this topic.

Hello @mahdiaqallal,
I’m referring to the fact Fedora CoreOS and Silverblue are both Fedora Linux in an Atomic OS using a hybrid packaging system. While Silverblue uses Anaconda for it’s installer, Fedora CoreOS uses an ignition file but also has a Live USB offering now too I think. Anyway, the ignotion file is created from a Yaml file you make that describes your installation, disk partitioning and all down to the installed software and user setup. It is largely more for an administered ecosystem but can be used on bare metal single user setup’s too. You can find the doc’s at https://docs.fedoraproject.org/en-US/fedora-coreos/ where you can learn more about it.

Let’s be careful here and not mix two things. Ignition is only used in Fedora CoreOS for now and Fedora CoreOS is for server/cluster/cloud deployments.

For Fedora Silverblue/Kinoite, you currently only have Kickstart as an option for install time configuration and then Ansible, Fleet Commander (requires FreeIPA or Active Directory) or other management tools once you have a system running.

For Kickstart, see:

Note however that some option/commands may not work as Silverblue/Kinoite is installed a bit differently.

You can get an example Kickstart by manually performing an installation via Anaconda and then looking in the /root folder for anaconda-ks.cfg:

I understand that, but ignition can be used to make a single user system if desired. It is also in some ways a more flexible approach to setting up a system initially. Anyway, I like the kickstart approach too.

I’m not sure I follow here. Kickstarts can not be used on Fedora CoreOS and Ignition can not be used on Fedora Silverblue/Kinoite. This may change in the future but this is the state right now.

The initial question was about Fedora Silverblue thus why I highlighted that here.

1 Like

Sorry I replied now actually.

Thank you all for your replies !

I’m customizing my future kickstart file as proposed by @siosm , using /root/anaconda-ks.cfg from a previous install as a template.

My first goal is to have formatted in btrfs the /home folder in a separate partition than /root etc…

  1. Since in the rpm-ostree system the tree is read-only except /var and /etc (in my understanding) how do I configure the syntax for the #Disk partitioning information part in the ks file

btrfs /home --subvol --name=home LABEL=home_fedora
or
btrfs /var/home --subvol --name=home LABEL=home_fedora

  1. To have applications installed beyond those included in Silverblue, what command lines to insert and where should I include them so as to install :
  • include new repositories (rpmfusion, copr etc…)
  • Flatpak commands installations
  • rpm installations when necessary

I’m quite new to Silverblue, so thanks for your help !

No worries and thanks for all you do around here. I wanted to make sure there was no confusion.

For 1 I think it’s the second option /var/home but I’m not really familiar with btrfs enough.
For 2. It might be easier to do that post installation via a script or via Ansible. There are example commands in the docs to install Flatpaks, etc.

When I did it, I made my subvolumes like so …
btrfs subvolume mounted at /, btrfs subvolume mounted at /var and btrfs subvolume mounted at /home. I am uncertain how the symlinking would go in the kickstart file way, but with anaconda, and using advanced blivet gui in the installer, I get the correct symlink setup (so home is /var/home in use).

1 Like

However @slosm:

  • When I update the /etc/fstab , having created the relevant btrfs subvolume associated to /home and with mountpoint (/var)/home, at reboot, everything seems fine: Files and folders are where they are expected to be. Either mountpoints in /etc/fstab work the same : /var/home or /home

  • But logging through tty with the username (below: “mahdiaqallal”) to whom the subfolder (/home/mahdiaqallal) does exist and is associated below /home, does produce an odd comment just after successfull terminal login:

fedora login: mahdiaqallal
Password:
Last login: Tue Apr 5 19:25:57 on tty3
– mahdiaqallal: /var/home/mahdiaqallal: change directory failed: No such file or directory
Logging in with home = “/”
Welcome to Fedora Silverblue. This terminal is running on the
host system. You may want to try out the Toolbox for a directly
mutable environment that allows package installation with DNF.

For more information, see the documentation.

mkdir: impossible to create folder ’ /var/home/mahdiaqallal ’ : Permission denied’
touch: impossible to touch ‘/var/home/mahdiaqallal/.config/toolbox/host-welcome–shown:’ No file or folder exists

What is the relevance of the message regarding system stability

This may be outside of what you are looking for, but I’ve found an interesting way to configure Silverblue post-installation using Ansible.

You can also take a look at my configuration, which is based on JayDoubleu’s above, used to setup my ostree-based XFCE variant: GitHub - hyperreal64/ansible-xfice: Ansible automation for my xfice Fedora desktop

Thanks @hyperreal and @siosm for your hints towards ansible :ok_hand:

I have for now absolutely no experience in ansible. I would be very interested indeed if ansible could help me achieve the second point in my goals:

Could ansible do this ?
Thanks

Note for @hyperreal : Your link doesn’t work anymore:

For working with Flatpaks in Ansible, you can use the community.general.flatpak collection (examples at the bottom of that page).

For working with rpm-ostree you have the community.general.rpm_ostree_pkg collection as an option.

For manipulating repositories you can use the ansible.builtin.template collection on Silverblue/CoreOS systems to inject repo files into /etc/yum.redos.d. For non-ostree rpm based systems you can use ansible.builtin.yum_repository.

For non-ostree systems such as Fedora Workstation or RHEL, you can use ansible.builtin.dnf, ansible.builtin.yum, or even ansible.builtin.package to manage packages.

1 Like

Ah, yeah my bad. I removed that repository. JayDoubleu/ansiblue is still there, though.

To answer your question, Ansible could be used to install flatpaks, new repos, and to overlay rpm packages. The Ansiblue repository I shared with you above provides a good example of how to do this. Here are the Ansible modules you’ll want to use:

:slightly_smiling_face:

1 Like