Prerequisites for the tutorials

Les tutoriels suivants ont pour objectif de vous aider à prendre en main Fedora CoreOS en apprenant à configurer automatiquement (ou provisionner) une instance lors de son premier démarrage. Les tutoriels se suivent dans un ordre logique, ainsi il est conseillé de les suivre dans l’ordre.

Si vous ne connaissez pas Fedora CoreOS, vous pouvez vous référer à la FAQ pour plus d’informations.

If you need any help or need to ask any questions while going through those tutorials, please join the IRC channel, or join our discussion board. If you find any issue in the tutorial, please report them in the fedora-coreos-docs issue tracker.

You should start with the setup instructions from this page as they must be completed first to be able to follow the tutorials.

Connection automatique et nom d’hôte personnalisé : Dans ce tutoriel, vous aller écrire votre première configuration Ignition et l’utiliser pour démarrer une instance Fedora CoreOS.

Lancement d’un service au premier démarrage : Dans ce tutoriel, vous aller apprendre à lancer un script personnalisé via une unité systemd lors du premier démarrage d’une instance Fedora CoreOS.

Accès en SSH et lancement de conteneurs : Dans ce tutoriel, vous aller apprendre à lancer un conteneur lors du premier démarrage avec podman.

Test des mises à jour de Fedora CoreOS : Dans ce tutoriel, vous allez apprendre comment sont gérées les mises à jour automatiques avec Fedora CoreOS et comment revenir en arrière en cas de problème.

Launching a user-level systemd unit on boot: There are times when it’s helpful to launch a user-level systemd unit without having to log in. This tutorial demonstrates creating a user-level systemd unit that launches on boot.

Virtualisation avec libvirt

These tutorials are written targeting a Linux environment with a working libvirt setup and hardware virtualization support via KVM. There is however nothing specific to the libvirt environment in those tutorials and you can thus try the same configurations on any platform where you have console access (or you can skip to the SSH access tutorial to get remote access).

For instructions to setup libvirt and KVM you may refer to the Getting started with virtualization guide from Fedora. Although this setup guide is focused on Fedora, the tutorials should work on any distribution with libvirt installed and running.

CoreOS tools

For the tutorials, we will need the following tools:

  • Butane: To generate Ignition configuration from Butane config files.

  • coreos-installer: To download the latest Fedora CoreOS QCOW2 image.

  • ignition-validate: To validate Ignition configuration files.

To keep all configurations files and Fedora CoreOS images in the same place, we will create a new directory to work from:

mkdir ~/coreos
cd ~/coreos

Setup with podman or docker

All of the tools required to work with Fedora CoreOS are available from containers hosted on quay.io:

podman pull quay.io/coreos/butane:release
podman pull quay.io/coreos/coreos-installer:release
podman pull quay.io/coreos/ignition-validate:release

To make it simpler to type, you may add the following aliases to your shell configuration:

alias butane='podman run --rm --tty --interactive \
              --security-opt label=disable        \
              --volume ${PWD}:/pwd --workdir /pwd \
              quay.io/coreos/butane:release'

alias coreos-installer='podman run --pull=always            \
                        --rm --tty --interactive            \
                        --security-opt label=disable        \
                        --volume ${PWD}:/pwd --workdir /pwd \
                        quay.io/coreos/coreos-installer:release'

alias ignition-validate='podman run --rm --tty --interactive \
                         --security-opt label=disable        \
                         --volume ${PWD}:/pwd --workdir /pwd \
                         quay.io/coreos/ignition-validate:release'

Vous pouvez alors utiliser coreos-installer pour télécharger la dernière image de la version stable avec :

coreos-installer download -p qemu -f qcow2.xz --decompress

To make the tutorial simpler, you should rename the image that we have just downloaded to a shorter name:

mv fedora-coreos-32.20200715.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

You are now ready to proceed with the first tutorial.

Installing via Fedora packages

All three tools (Butane, coreos-installer, and ignition-validate) are available as Fedora packages:

# Installation des outils
sudo dnf install -y butane coreos-installer ignition-validate

# Téléchargement de la dernière version stable de Fedora CoreOS dans le format d'image QCOW2
coreos-installer download -p qemu -f qcow2.xz --decompress

To make the tutorial simpler, you should rename the image that we have just downloaded to a shorter name:

mv fedora-coreos-32.20200715.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

You are now ready to proceed with the first tutorial.

Téléchargement manuel

If none of the previous solutions work for you, you can still manually download Fedora CoreOS from getfedora.org with:

RELEASE="32.20200715.3.0" # Update this with the latest release from https://getfedora.org/en/coreos
curl -O https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/$RELEASE/x86_64/fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz
curl -O https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/$RELEASE/x86_64/fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz.sig

Once the archive has been downloaded, make sure to verify its integrity by following the instructions available by clicking on the Verify signature & SHA256 button. You will have to download the checksum file, the signature and Fedora GPG keys to verify your download:

curl https://getfedora.org/static/fedora.gpg | gpg --import
gpg --verify fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz.sig

Once you have verified the archive, you can extract it with:

unxz fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz

To make the tutorial simpler, you should rename the image that we have just downloaded to a shorter name:

mv fedora-coreos-32.20200715.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

Vous pouvez ensuite télécharger la dernière versions de Butane et ignition-validate depuis GitHub :

# Butane
curl -OL https://github.com/coreos/butane/releases/download/v0.11.0/butane-x86_64-unknown-linux-gnu
curl -OL https://github.com/coreos/butane/releases/download/v0.11.0/butane-x86_64-unknown-linux-gnu.asc
gpg --verify butane-x86_64-unknown-linux-gnu.asc
mv butane-x86_64-unknown-linux-gnu butane
chmod a+x butane

# ignition-validate
curl -OL https://github.com/coreos/ignition/releases/download/v2.5.0/ignition-validate-x86_64-linux
curl -OL https://github.com/coreos/ignition/releases/download/v2.5.0/ignition-validate-x86_64-linux.asc
gpg --verify ignition-validate-x86_64-linux.asc
mv ignition-validate-x86_64-linux ignition-validate
chmod a+x ignition-validate

Vous pouvez alors définir des alias pour butane et ignition-validate :

alias butane="${PWD}/butane"
alias ignition-validate="${PWD}/ignition-validate"

Ou alors déplacer ces commandes dans un dossier qui est inclus dans votre $PATH, par exemple :

mv butane ignition-validate "${HOME}/.local/bin/"
# Ou
mv butane ignition-validate "${HOME}/bin"

You are now ready to proceed with the first tutorial.