A playbook for installing and running a Gitlab Runner instance using Podman using a normal user. The container still needs to run privileged.
Supports Fedora 33, Debian 12.
$ ansible-galaxy collection install zedr.gitlab_runner
Build the collection:
$ ansible-galaxy collection build -vvv -f --output-path ./build
Install the collection:
$ ansible-galaxy collection install -vvv build/*.tar.gz
Example playbook:
- hosts: all
collections:
- zedr.gitlab_runner
roles:
- role: gitlab_runner
See the role documentation for additional configuration.
OS:
- libvirt-devel
Start the test suite by creating the VM and converging using the role:
$ make converge
Verify that the test suite passes:
$ make verify
Destroy the VM:
$ make destroy
$ CLOUD_IMAGE_URL=file:///home/zedr/Archive/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 \
make converge
$ EXTRA_VARS="custom_runner_image=quay.io/myrepo/gitlab-runner:latest \
custom_registry_host=quay.io \
custom_registry_username=my_quay_user \
custom_registry_password=my_quay_pass" \
MOLECULE_SCENARIO="registry_auth" \
make converge
Use with:
$ vagrant up
Destroy the VM with make destroy
and retry.
A sporadic issue causing the error message Failed to download metadata for repo 'fedora-modular': Cannot prepare internal mirrorlist: Status code: 503
seems to be unrelated to the role and its tests. Try launching the tests again.
Running systemd ctl commands as an unprivileged user might yield an error Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
Try defining the env var XDG_RUNTIME_DIR
, e.g. XDG_RUNTIME_DIR=/run/user/$UID systemctl --user status