(These are just notes for guidance, pending adding my current implementation to GitHub.)
Two issues:
- The gitlab-runner module in Ansible supports only a limited number of options, and most of the (necessary) others have to be set manually in the runner configuration file. The
gitlab-runner register
command now supports the use of configuration templates to merge extra settings, but the module currently does not. - The GitLab API no longer has a method to return runner tokens after registration (for "seh-cyur-reh-teh"). The only place you can find the token after registration is in the runner configuration file. The token for each runner must be retained otherwise they'll be seen as new instances.
Therefore, to be able to register or modify runners in an idempotent way, you must retrieve the tokens for any currently registered tokens from the runner configuration file (/etc/gitlab-runner/config.toml
) before updating it.