Yomi
Yet one more installer
Install / Use
/learn @openSUSE/YomiREADME
Yomi - Yet one more installer
Table of contents
- Yomi - Yet one more installer
What is Yomi
Yomi (yet one more installer) is a new proposal for an installer for the [open]SUSE family. It is designed as a SaltStack state, and expected to be used in situations were unattended installations for heterogeneous nodes is required, and where some bits of intelligence in the configuration file can help to customize the installation.
Being also a Salt state makes the installation process one more step during the provisioning stage, making on Yomi a good candidate for integration in any workflow were SaltStack is used.
Overview
To execute Yomi we need a modern version of Salt, as we need special features are only on the master branch of Salt. Technically we can use the last released version of Salt for salt-master, but for the minions we need the most up-to-date version. The good news is that most of the patches are currently merged in the openSUSE package of Salt.
Yomi is developed in OBS, and actually consists on two components:
- yomi-formula: contains the Salt states and modules requires to drive an installation. The source code of the project in available under the openSUSE group in GitHub.
- openSUSE-Tubleweed-Yomi:
is the image that can be used too boot the new nodes, that includes
the
salt-minionservice already configured. There are two versions of this image, one that is used as a LiveCD image and other designed to be used from a PXE Boot server.
The installation process of Yomi will require:
- Install and configure the
salt-masterservice. - Install the
yomi-formulapackage. - Prepare the pillar for the new installations.
- Boot the new systems with the ISO image or via PXE boot
Currently Yomi support the installation under x86_64 and ARM64 (aarch64) with EFI.
Installing and configuring salt-master
SaltStack can be deployed with different architectures. The
recommended one will require the salt-master service.
zypper in salt-master
systemctl enable --now salt-master.service
Other ways to install salt-master
For different ways of installation, read the official documentation. For example, for development purposes installing it inside a virtual environment can be a good idea:
python3 -mvenv venv
source venv/bin/activate
pip install --upgrade pip
pip install salt
# Create the basic layout and config files
mkdir -p venv/etc/salt/pki/{master,minion} \
venv/etc/salt/autosign_grains \
venv/var/cache/salt/master/file_lists/roots
cat <<EOF > venv/etc/salt/master
root_dir: $(pwd)/venv
file_roots:
base:
- $(pwd)/srv/salt
pillar_roots:
base:
- $(pwd)/srv/pillar
EOF
Looking for the pillar
Salt pillar are the data that the Salt states use to decide the actions that needs to be done. For example, in the case of Yomi the typical data will be the layout of the hard disks, the software patterns that will be installed, or the users that will be created. For a complete explanation of the pillar required by Yomi, check the section Pillar in Yomi
By default Salt will search the states in /srv/salt, and the pillar
in /srv/pillar, as established by file_roots and pillar_roots
parameters in the default configuration file (/etc/salt/master).
To indicate a different place where to find the pillar, we can add a
new snippet in the /etc/salt/master.d directory:
cat <<EOF > /etc/salt/master.d/pillar.conf
pillar_roots:
base:
- /srv/pillar
- /usr/share/yomi/pillar
EOF
The yomi-formula package already contains an example of such
configuration. Check section Looking for the pillar in
Yomi
Enabling auto-sign
To simplify the discovery and key management of the minions, we can
use the auto-sign feature of Salt. To do that we need to add a new
file in /etc/salt/master.d.
echo "autosign_grains_dir: /etc/salt/autosign_grains" > \
/etc/salt/master.d/autosign.conf
The Yomi ISO image available in Factory already export some UUIDs generated for each minion, so we need to list into the master all the possible valid UUIDs.
mkdir -p /etc/salt/autosign_grains
for i in $(seq 0 9); do
echo $(uuidgen --md5 --namespace @dns --name http://opensuse.org/$i)
done > /etc/salt/autosign_grains/uuid
The yomi-formula package already contains an example of such
configuration. Check section Enabling auto-sing in
Yomi
Salt API
The salt-master service can be accessed via a REST API, provided by
an external tool that needs to be enabled.
zypper in salt-api
systemctl enable --now salt-api.service
There are different options to configure the salt-api service, but
is safe to choose CherryPy as a back-end to serve the requests of
Salt API.
We need to configure this service to listen to one port, for example 8000, and to associate an authorization mechanism. Read the Salt documentation about this topic for different options.
cat <<EOF > /etc/salt/master.d/salt-api.conf
rest_cherrypy:
port: 8000
debug: no
disable_ssl: yes
EOF
cat <<EOF > /etc/salt/master.d/eauth.conf
external_auth:
file:
^filename: /etc/salt/user-list.txt
salt:
- .*
- '@wheel'
- '@runner'
- '@jobs'
EOF
echo "salt:linux" > /etc/salt/user-list.txt
The yomi-formula package already contains an example of such
configuration. Check section Salt API in Yomi
The Yomi formula
The states and modules required by Salt to drive an installation can
be installed where the salt-master resides:
zypper in yomi-formula
This package will install the states in
/usr/share/salt-formulas/states, some pillar examples in
/usr/share/yomi/pillar and configuration files in /usr/share/yomi.
Looking for the pillar in Yomi
Yomi expect from the pillar to be a normal YAML document, optionally generated by a Jinja template, as is usual in Salt.
The schema of the pillar is described in the section Pillar reference
for Yomi, but the yomi-formula package
provides a set of examples that can be used to deploy MicroOS
installations, Kubic, LVM, RAID or simple openSUSE Tumbleweed ones.
In order to salt-master can find the pillar, we need to change the
pillar_roots entry in the configuration file, or use the one
provided by the package:
cp -a /usr/share/yomi/pillar.conf /etc/salt/master.d/
systemctl restart salt-master.service
Enabling auto-sign in Yomi
The images generated by the Open Build Service that are ready to be
used together with Yomi contains a list a random UUID, that can be
used as a auto-sign grain in salt-master.
We can enable this feature adding the configuration file provided by the package:
cp /usr/share/yomi/autosign.conf /etc/salt/master.d/
systemctl restart salt-master.service
Salt API in Yomi
As described in the section Salt API, we need to enable
the salt-api service in order to provide a REST API service to
salt-minion.
This service is used by Yomi to monitor the installation, reading the
event bus of Salt. To enable the real-time events we need to enable
set events field to yes in the configuration section of the
pillar.
We can enable this service easily (after installing the salt-api
package and the dependencies) using the provided configuration file:
cp /
