Skip to content

gitlab-runner register should NOT modify a config - it should place a token in a separate file

The way gitlab-runner register works is extremely inconvenient for devops workflows. The command that self-modifies its own config cannot be automated with Chef/Ansible in any reasonable way, especially modifications-wise. action :create, then gitlab-runner register, and then you're stuck with your config forever. Or action :create_or_update and have your runner re-register every Chef run, and end up with a list of thousands of runners at /admin/runners, with no way to mass-delete them. I think the only devops-friendly way to handle gitlab-runner register is to store the [[runners]] -> token value in a separate file so the main config can be managed by any CM tool without an issue.

Please let us keep /etc/gitlab-runner/config.toml the way we want with Chef/Ansible - and read the token from (for example) /etc/gitlab-runner/token.

This will auto-magically solve ubiquitous problems related to gitlab-runner register:

CC @ayufan @grzesiek @markpundsack @jlenny

Edited by Damian Nowak