ci: add the root user to the libvirt group

When starting a minikube VM, there are always warning messages like
this:

    X libvirt group membership check failed:
    user is not a member of the appropriate libvirt group

The CI jobs run as root, so minikube works just fine. By adding the root
user to the libvirt group, the warning is hopefully removed.

Note that the libvirt group may not exist yet, as the packages will get
installed in a later stage. This change also adds a check to create the
libvirt group in case it is missing.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-07-16 11:44:55 +02:00 committed by mergify[bot]
parent f129719f18
commit c90023ad5d

View File

@ -80,6 +80,10 @@ set -x
dnf -y install git podman make
# minikube wants the user (everything runs as root) to be in the libvirt group
getent group libvirt || groupadd --system libvirt
usermod --append --groups libvirt root
# if --history is passed, don't pass --depth=1
depth='--depth=1'
if [[ "${history}" == 'yes' ]]