-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manage entire config.toml #18
Comments
Thanks for re-opening. I know it can be a pain, but when it's feasible, i prefer the original authorship of the issue to be retained. |
I was about to implement this when I discovered the suboptimal registering process of Gitlab runners...
As we can never really know the runner token when configuring it in Puppet, we need to do the registration process ourself as explained in https://gitlab.com/gitlab-org/gitlab-runner/issues/985#note_3175185 |
@baurmatt we COULD have a fact that pulls the token from what the current sets up in config.. and then WHEN we have something in that fact.. trigger a rewrite of the config toml file ? |
I don't like to abuse facts for this especially since Puppet runs aren't idempotent anymore. I think we should go with the self registration of the runner --> https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner I see two options here:
|
It could be an optional feature - that happens to depend on puppet6 (if that can be done cleanly) Deferred values are cleaner - but not much different from using a fact for the task (and they are from puppet 5.6.. ) |
Hmm thought about this over lunch... This isn't going to work as the function/type would register a new runner on every run :( |
If more people show interest to get this issue solved, we will got a path: Please consider to add comment there. |
@Dan33l as we're a paying customer of Gitlab Enterprise, I've directly contacted the official support channel. Perhaps this draw's some attention on this issue :) |
Looks like this isn't going to happen. How about this: We're dropping the support of register/unregister a runner but expect people to give We could provide a simple script (Bolt task?) which does the registration/unregistration in the first place. This would allow us to drop the Looking forward to your opinions! :) |
I've completely refactored I've also added Bolt tasks in #73 because however we decide, I think they're good to have. Now its your turn: Please decide if you think it is ok to drop the (un)registration from |
This uses the foundation laid in dea2342 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
I've build this in #75. Take a look and tell me what you think! :) |
I love this solution.. very cool using the defined params in puppets class, and just convert directly to toml for the file.. no template actually needed :) |
This uses the foundation laid in 26617fd and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
@KlavsKlavsen Absolutely, I already have some of the data types laying around but they're HUGE. So I thought it's easier to review in an additional pull request. |
This uses the foundation laid in 26617fd and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 26617fd and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in e99ffe0 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in e99ffe0 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 75a21b61ace991d65864721ccd82499c46c5acf6 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
Sooo, after some testing I've realized that, at least in our environment, registering a runner is often crucial and shouldn't be an extra Bolt task. After playing around with it for some time, it turns out that the best option is to use a Deferred function. Due to this being a Puppet 6 only functionality, there will like be no support for automatically registering runners on Puppet 5 (everything below is already EOL). Users requiring Puppet 5 and auto-registration would need to stay on a version which included the current But this gives us the ability to full support auto registration and full config management. I'm not yet fully satisfied with the code, but if you want to take a look go over here --> https://github.com/syseleven/puppet-gitlab_ci_runner/tree/move-to-concat-deferred High level overview how it works:
Only problem with this is, that the I will polish that branch over the next weeks and submit a PR after my current PRs are reviewed - don't want to overload the PR queue :) |
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
Before this, the complete hash with all runners was injected into gitlab_ci_runner::runner. Based on the title of the resource it was then decided which runner should be extracted from the global hash and merge with defaults ect. This was completely refactored in a way that a single gitlab_ci_runner::runner resource now only holds all data which is need to configure it but no other. This also changes the default of gitlab_ci_runner::runners(_defaults) to an empty hash because I don't see why we need to force user to configure it. Move global options to toml generation This drop the 'builds_dir' and cache_dir because they are runner specific parameter rather than global ones. The 'metrics_server' parameter gets dropped as well because it was deprecated almost 2 years ago. Furthermore, this commit introduce all missing global configuration options which are 'log_level', 'log_format' and 'check_interval'. Move runner configuration from exec to concat::fragment This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73. move-to-concat - Move TOML creation to its own function move-to-concat-deferred - Refactor to use a library move-to-concat-deferred - bolt-tasks - Add register/unregister Puppet functions move-to-concat-deferred - Allow $config['token'] to be a deferred function move-to-concat-deferred - Allow auth and reg token to be retrieved by a Deferred function move-to-concat-deferred - Don't depend on toml-rb, included the dumper.rb from their move-to-concat-deferred - Save
Before this, the complete hash with all runners was injected into gitlab_ci_runner::runner. Based on the title of the resource it was then decided which runner should be extracted from the global hash and merge with defaults ect. This was completely refactored in a way that a single gitlab_ci_runner::runner resource now only holds all data which is need to configure it but no other. This also changes the default of gitlab_ci_runner::runners(_defaults) to an empty hash because I don't see why we need to force user to configure it. Move global options to toml generation This drop the 'builds_dir' and cache_dir because they are runner specific parameter rather than global ones. The 'metrics_server' parameter gets dropped as well because it was deprecated almost 2 years ago. Furthermore, this commit introduce all missing global configuration options which are 'log_level', 'log_format' and 'check_interval'. Move runner configuration from exec to concat::fragment This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73. move-to-concat - Move TOML creation to its own function move-to-concat-deferred - Refactor to use a library move-to-concat-deferred - bolt-tasks - Add register/unregister Puppet functions move-to-concat-deferred - Allow $config['token'] to be a deferred function move-to-concat-deferred - Allow auth and reg token to be retrieved by a Deferred function move-to-concat-deferred - Don't depend on toml-rb, included the dumper.rb from their move-to-concat-deferred - Save
Before this, the complete hash with all runners was injected into gitlab_ci_runner::runner. Based on the title of the resource it was then decided which runner should be extracted from the global hash and merge with defaults ect. This was completely refactored in a way that a single gitlab_ci_runner::runner resource now only holds all data which is need to configure it but no other. This also changes the default of gitlab_ci_runner::runners(_defaults) to an empty hash because I don't see why we need to force user to configure it. Move global options to toml generation This drop the 'builds_dir' and cache_dir because they are runner specific parameter rather than global ones. The 'metrics_server' parameter gets dropped as well because it was deprecated almost 2 years ago. Furthermore, this commit introduce all missing global configuration options which are 'log_level', 'log_format' and 'check_interval'. Move runner configuration from exec to concat::fragment This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73. move-to-concat - Move TOML creation to its own function move-to-concat-deferred - Refactor to use a library move-to-concat-deferred - bolt-tasks - Add register/unregister Puppet functions move-to-concat-deferred - Allow $config['token'] to be a deferred function move-to-concat-deferred - Allow auth and reg token to be retrieved by a Deferred function move-to-concat-deferred - Don't depend on toml-rb, included the dumper.rb from their move-to-concat-deferred - Save
@baurmatt Sorry your PR didn't get the attention it deserved at the time. Are you interested in reviving this work now that we can drop support for Puppet 5 if we want? |
@alexjfisher I would absolutely be interested in getting #75 merged! If you're up to reviewing the PR, I'm happy to rebase it and solve all merge conflicts. As I'm currently not working very much with Puppet anymore, I need to find some time to get back into the code again. |
I'm also thinking I need autoregistration and full management of the config file. Which branch of yours am I best looking at?
Maybe just a toml-rb-gem-version fact or similar would be ok for this? (Even if it does then take 2 puppet runs) |
I'm liking your (FWIW, in the current module version, I could hack proxy support during registration in my profile) # outrageous hack to get runner registration to use proxy
Exec <| title == 'Register_runner_testrpms' |> {
environment => [
"HTTPS_PROXY=http://${proxy_host}:${proxy_port}",
"https_proxy=http://${proxy_host}:${proxy_port}",
],
} What are your thoughts? Would you like to rebase and put up a new PR based on this branch? Now that Puppet 5 is EOL and we've already dropped support for it in many modules, feel free to rip out any compatibility code if you think that makes things simpler. |
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
Uff, wow this is really a mess :( Sorry about that! We're currently using the branch I could successfully rebase #75 and was also able to fix some unrelated CI issues in #103. Please review and merge #103 first. |
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
This uses the foundation laid in 9ff7b03 and moves the runner configuration from execs to concat::fragments. This was done to be able to change (parts) of the runner configuration after the inital Puppet run which is not possible with the exec because there is no config update logic in the gitlab-runner binary. Sadly this drops the support for autoregistering a runner on a Gitlab instance as discussed in voxpupuli#18. The registration can be done with Bolt task provide in voxpupuli#73.
for some reason I've hit a docker issue with DNS lookups.. so I need to add:
extra_hosts = ["mygiturl:mygithostip"] - to config.toml - under runners.docker.
The module does not support this currently.. and does not handle if config.toml file is missing :(
I'd also like to set priviledged to true.
(issue migrated from voxpupuli/puppet-gitlab#121 )
The text was updated successfully, but these errors were encountered: