Instead of Puppet just hanging for 60 seconds and then printing a very
vague execution expired
message, catch any timeouts and make it clear
that Puppet was executing the Deferred function in the first place.
Clone of #129
This PR adds Gitlab's Apt sigining key directly from the source instead of relying on keyserver.ubuntu.com (which currently doesn't seem to provide the key when running
/usr/bin/apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6403F6544A38863DAA0B6E03F01618A51312F3F
which is what this module attempts to do on Debian-based systems.).
Added an optional parameter ca_file
to APIClient
that can specify a certificate authority file.
Added an optional parameter ca_file
to gitlab_ci_runner
and gitlab_ci_runner::runner
Fixes #124
Fixes issue 144 by adding a check to confirm if the ca_file set in the parameters actually exists on the machine.
This problem causes Puppet runs to completely fail when using a Gitlab server with an internally signed CA. Making it impossible to install the ca file with Puppet when the gitlabcirunner module is in use.
Added rspec test to check this new condition.
Tests passing in github actions (with the exception of the Ubuntu 18.04 on Puppet 6 which was already failing.).
Docker build . test passing (to the same standard as the existing master branch). Output provided below.
I'm not sure if we should output a message to the user. See registertofile.rb line 46. Or it should be let to fail silently. Thoughts?
Fixes #144
[8/9] RUN bundle exec rake release_checks:
12 1.020 ruby -c lib/puppet/functions/gitlabcirunner/unregisterfromfile.rb
12 1.049 Syntax OK
12 1.050 ruby -c lib/puppet/functions/gitlabcirunner/register.rb
12 1.078 Syntax OK
12 1.079 ruby -c lib/puppet/functions/gitlabcirunner/unregister.rb
12 1.105 Syntax OK
12 1.106 ruby -c lib/puppet/functions/gitlabcirunner/to_toml.rb
12 1.131 Syntax OK
12 1.132 ruby -c lib/puppet/functions/gitlabcirunner/registertofile.rb
12 1.159 Syntax OK
12 1.160 ruby -c lib/puppet_x/gitlab/dumper.rb
12 1.186 Syntax OK
12 1.187 ruby -c lib/puppet_x/gitlab/runner.rb
12 1.212 Syntax OK
12 1.213 ---> syntax:manifests
12 1.361 ---> syntax:templates
12 1.388 ---> syntax:hiera:yaml
12 1.406 I, [2022-03-07T06:11:38.471937 #8] INFO -- : Creating symlink from spec/fixtures/modules/gitlabcirunner to /opt/puppet
12 1.411 Cloning into 'spec/fixtures/modules/stdlib'...
12 1.413 Cloning into 'spec/fixtures/modules/rubytaskhelper'...
12 1.416 Cloning into 'spec/fixtures/modules/apt'...
12 1.419 Cloning into 'spec/fixtures/modules/concat'...
12 1.422 Cloning into 'spec/fixtures/modules/docker'...
12 1.425 Cloning into 'spec/fixtures/modules/translate'...
12 1.428 Cloning into 'spec/fixtures/modules/yumrepo_core'...
12 3.003 4 processes for 10 specs, ~ 2 specs per process
12 4.128 ..
12 4.141 An error occurred while loading ./spec/tasks/unregisterrunnerspec.rb. - Did you mean?
12 4.141 rspec ./spec/tasks/registerrunnerspec.rb
12 4.141
12 4.141 Failure/Error: requirerelative '../../tasks/unregisterrunner'
12 4.141
12 4.141 LoadError:
12 4.141 cannot load such file -- /opt/rubytaskhelper/files/task_helper
12 4.141 # ./tasks/unregisterrunner.rb:5:in `requirerelative'
12 4.141 # ./tasks/unregister_runner.rb:5:in `'
12 4.141 # ./spec/tasks/unregisterrunnerspec.rb:4:in `require_relative'
12 4.141 # ./spec/tasks/unregisterrunnerspec.rb:4:in `'
12 4.141
12 4.141
12 4.141 Finished in 0.00002 seconds (files took 0.97614 seconds to load)
12 4.141 0 examples, 0 failures, 1 error occurred outside of examples
12 4.141
12 4.146 .......Specified CA file doesn't exist for gitlab-ci-runner. Did you forget to create it?
12 4.212 .............................
12 4.458
12 4.458 Finished in 0.38674 seconds (files took 0.91178 seconds to load)
12 4.458 38 examples, 0 failures
12 4.458
12 7.580
12 7.580 An error occurred while loading ./spec/tasks/registerrunnerspec.rb. - Did you mean?
12 7.580 rspec ./spec/tasks/unregisterrunnerspec.rb
12 7.580
12 7.580 Failure/Error: requirerelative '../../tasks/registerrunner'
12 7.580
12 7.580 LoadError:
12 7.580 cannot load such file -- /opt/rubytaskhelper/files/task_helper
12 7.580 # ./tasks/registerrunner.rb:5:in `requirerelative'
12 7.580 # ./tasks/register_runner.rb:5:in `'
12 7.580 # ./spec/tasks/registerrunnerspec.rb:4:in `require_relative'
12 7.580 # ./spec/tasks/registerrunnerspec.rb:4:in `'
12 7.580
12 7.580
12 7.580 Finished in 0.00002 seconds (files took 4.42 seconds to load)
12 7.580 0 examples, 0 failures, 1 error occurred outside of examples
12 7.580
12 7.840 .................................................................................................................................................................................................................................................................................................................................................................................................
12 21.23
12 21.23 Coverage Report:
12 21.23
12 21.23 Total resources: 21
12 21.23 Touched resources: 16
12 21.23 Resource coverage: 76.19%
12 21.23
12 21.23 Untouched resources:
12 21.23 Concat::Fragment[/etc/gitlab-runner/config.toml - runnerwithensure_present]
12 21.23 Concat::Fragment[/etc/gitlab-runner/config.toml - test_runner]
12 21.23 File[/etc/gitlab-runner/auth-token-runnerwithensure_absent]
12 21.23 Package[xz-utils]
12 21.23 Package[xz]
12 21.23
12 21.23
12 21.23 Finished in 13.73 seconds (files took 4.34 seconds to load)
12 21.23 385 examples, 0 failures
12 21.23
12 21.25 Tests Failed
12 21.26
12 21.26 2 errors, 423 examples, 0 failures
12 21.26
12 21.26 Took 18 seconds
```
<!--
Thank you for contributing to this project!
-->
Adds some parameters to apt::source
on debian family when managing repo.
Fixes #99
This PR adds Gitlab's Apt sigining key directly from the source instead of relying on keyserver.ubuntu.com (which currently doesn't seem to provide the key when running
/usr/bin/apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6403F6544A38863DAA0B6E03F01618A51312F3F
which is what this module attempts to do on Debian-based systems.).
Fixes #128
<!--
Thank you for contributing to this project!
-->
<!--
Replace this comment with a description of your pull request.
-->
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->