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
:
-
gitlab-runner register
not supporting concurrency switch, and other top-level options - #1539, https://gitlab.com/gitlab-org/gitlab-ce/issues/20391, #3540 - having comments removed from config.toml file - #2829 (closed)
- not being able to use Chef/Ansible to makange config.toml in a reasonable way
CC @ayufan @grzesiek @markpundsack @jlenny