Skip to content
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

Reformat registration options in --option=value output #189

Closed
mjburling opened this issue Feb 3, 2018 · 1 comment
Closed

Reformat registration options in --option=value output #189

mjburling opened this issue Feb 3, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@mjburling
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.9
  • Ruby: ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: CentOS 7.4
  • Module version: Master branch, v1.16.0 [2017-12-13]

How to reproduce (e.g Puppet code you use)

# excerpt from from hieradata
gitlab_ci_runners_defaults:
  docker-allowed-images:
    - docker.internalnet.net/library/golang:*
    - docker.internalnet.net/library/python:*
    - docker.internalnet.net/rbh/*
  docker-extra-hosts:
    - hub.docker.io:127.0.0.1
  docker-image: docker.internalnet.net/rbh/java-8
  docker-volumes:
    - /cache
    - /home/gitlab-runner/.aws:/root/.aws:ro
    - /home/gitlab-runner/.gnupg:/root/.gnupg:ro
    - /home/gitlab-runner/.gradle/caches:/root/.gradle/caches:rw
    - /home/gitlab-runner/.gradle/gradle.properties:/root/.gradle/gradle.properties:ro
    - /home/gitlab-runner/.grails:/root/.grails:rw
    - /home/gitlab-runner/.ivy2:/root/.ivy2:rw
    - /home/gitlab-runner/.m2/repository:/root/.m2/repository:rw
    - /home/gitlab-runner/.m2/settings.xml:/root/.m2/settings.xml:ro
    - /home/gitlab-runner/.npm:/root/.npm:rw
    - /home/gitlab-runner/.npmrc:/root/.npmrc:ro
    - /home/gitlab-runner/.pulp/admin.conf:/root/.pulp/admin.conf:ro
    - /home/gitlab-runner/.pulp/uploads:/home/gitlab-runner/.pulp/uploads:rw
    - /home/gitlab-runner/.rbh:/root/.rbh:ro
    - /home/gitlab-runner/.sbt:/root/.sbt:rw
    - /home/gitlab-runner/.yarn:/root/.yarn:rw
    - /root/.ssh:/root/.ssh:ro
  executor: docker
  locked: false
  registration-token: ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEALjOs1qU836S2aoprIVmpEsbhvIvyZYOn1N7Xu+BlX1B11Yo4JpI/s2WAl19jRHBHyypzOftzmM52oQZKjdE4ipz51j1TqhujZg5FQqLuDzVoMUKGlKxMgXCLkEOKr4X+SyodpNhxQLYXCsXSTqZoRy66qgTxTLpWbirOFbY9un/C1kM3ANxlrjFcoGMjxhMYmgLCpxyEo+udtongKFfAgUtbQdNPLIdtOtXfcIpwFUK95WID01/7ziVg1jnGGwKr+GItGwGNjjflahGewRXcHyFBltGwbnYzfaueojP0AGXwqpupX2fiW7DWoJ15AnSiw8uYEFYrh4j1oaZGiB/7WzBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBDO/vwap9nH5SoE+l0KV5VdgCCx0pSij1URTQrczgfeybMN+658TEQiA0J5G/d1NnEAOg==]
  tag-list: docker,build,highmem
  url: "%{lookup('gitlab_external_url')}"

What are you seeing

Some keys, perhaps just the locked key for use in the gitlab-runner register step, are misinterpreted by the ruby CLI library. Despite the fact the Gitlab team say they have fixed this as of version 10.0.2, it appears that it's not working correctly.

What behaviour did you expect instead

Expecting to be able to create ci runners in an unsupervised fashion that are fully functional.

Output log

Notice: /Stage[main]/Gitlab::Cirunner/Gitlab::Runner[teng4317-gitlabci-docker-c534]/Exec[Register_runner_teng4317-gitlabci-docker-c534]/returns: PANIC: The url needs to be entered

Any additional information you'd like to impart

The suggestion was to use --key=value formatting in this closed issue https://gitlab.com/gitlab-org/gitlab-runner/issues/2782

I've cloned this repository, and haven't done extensive testing, but it appears to be working as expected with a minor adjustment to the runner.pp manifest:

  # Convert configuration into a string
  $parameters_array = join_keys_to_values($_config, '=') # adding the '=' allows this to function.
  $parameters_array_dashes = prefix($parameters_array, '--')
  $parameters_string = join($parameters_array_dashes, ' ')
@juniorsysadmin juniorsysadmin added the enhancement New feature or request label Feb 3, 2018
@LongLiveCHIEF
Copy link
Contributor

Can you please re-open this in https://github.com/voxpupuli/puppet-gitlab_ci_runner? This functionality is being moved out into its own module.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants