-
-
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
Runners try to register before Gitlab installed and/or ready #146
Comments
Have you tried using contain instead of include?
|
I've tried your suggestion but I'm getting the same results. I did notice that the puppet run is failing at https://github.com/voxpupuli/puppet-gitlab_ci_runner/blob/master/lib/puppet/functions/gitlab_ci_runner/register_to_file.rb#L44 before the class module even has a chance to do anything or that resource ordering is enforced. |
@tuxmea The registering takes place in a Deferred function that gets run before any of the rest of the catalog is actually applied. If you're installing a runner on the same host as gitlab is being installed, then you might want to wrap the gitlab runner part of your puppet code in a fact that checks if gitlab itself has been installed yet. Doesn't look like https://github.com/voxpupuli/puppet-gitlab contains any facts, but creating a simple Then your puppet code might look a bit like... include gitlab
if $facts['gitlab_installed'] {
include gitlab_ci_runner
} else {
notify { 'Rerun puppet to install gitlab runner':}
} Your custom fact (which you could put in your profile module) may be as simple as something like ... # profile/lib/facter/gitlab_installed.rb
Facter.add(:gitlab_installed) do
setcode do
File.exist?('/path/to/some/file/that/exists/after/gitlab/is/installed')
end
end Hope that helps. |
Just spotted this 'draft' PR. puppetlabs/puppet#8902 :) |
👋 Hope to have the deferred PR more ready to go next week. It'll fix two important limitations with Deferred functions.
|
Hi, this problem still exists in puppet 7.19...
here is a trace:
|
I would like to comment that I just tested setting Which seems to get around the issue for me of launching an EC2 runner from zero. I tested against 4.4.0. EDIT: Actually that only gets you a little further along in puppet setup.
|
Affected Puppet, Ruby, OS and module versions/distributions
puppet-agent-7.15.0-1.el8.x86_64
puppetserver-7.6.1-1.el7.noarch
Ruby:
Distribution:
Puppet server: Red Hat Enterprise Linux Server release 7.9 (Maipo)
Puppet agent: Red Hat Enterprise Linux release 8.1 (Ootpa)
Module version:
4.3.0
How to reproduce (e.g Puppet code you use)
Puppet manifest:
Hiera data:
What are you seeing
When running the puppet manifest, the gitlab_ci_runner https://github.com/voxpupuli/puppet-gitlab_ci_runner/blob/master/manifests/init.pp#L139 tries to connect to the local machine before gitlab is installed from the include ::gitlab code.
What behaviour did you expect instead
I expected Gitlab class module to run and install Gitlab CE and then the gitlab_ci_runner class module register the runners.
Output log
Any additional information you'd like to impart
Of course, since Gitlab isn't installed there's no way to configure the runners.
I've been out of the Puppet world for about four years so I'm rusty. I'm not familiar with Deferred Functions.
Is the resource ordering above not correct? Is there a way in the puppet module to ensure that the runners are registered later/last?
The text was updated successfully, but these errors were encountered: