Gitlab registration token should be replaced by Gitlab runner authentication token ?
In prerequisites, for this section:
Gitlab runner registration token should be added as a variable
TF_VAR_REGISTRATION_TOKEN
of type Variable in CI/CD settings. This token will allow virtual machines deployed by OpenTofu to register themselves as GitLab runners to execute jobs in the project pipeline. To get the registration token:
- On the left sidebar in the Gitlab interface, go to Settings → CI/CD.
- Expand Runners.
- In the Project runners section, click on the button with 3 points close to New project runner, it will open a Registration token window. There is a button Copy token just after the token to copy it to the clipboard.
Notes: In this example, the same project is used for hosting the OpenTofu configuration files and the build steps that are executed on the virtual machines maintained by OpenTofu, but this is not necessary the case. A distinct project can be dedicated to maintain the infrastructure by OpenTofu, with a variable
REGISTRATION_TOKEN
that points to another project dedicated for the build itself.
I don't have the same web interface. Ithink that it is due to new gitlab runner authentication mechanism.
When creating a new gitlab runner, I get this final page with the runner authentication token instead of registration token: