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

config.toml content is not expected cause gitlab-runner can't start #141

Open
YutangShi opened this issue Feb 15, 2022 · 2 comments
Open

Comments

@YutangShi
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.26.0
  • Ruby: 2.5.1p57
  • Distribution: Ubuntu 18.04(bionic)
  • Module version: 4.3.0

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

Here is my yaml config.

docker::version: "5:19.03.12~3-0~ubuntu-%{facts.os.distro.codename}"
docker::root_dir: /data/docker
docker::storage_driver: overlay2

gitlab_ci_runner::concurrent: 4
gitlab_ci_runner::manage_docker: true

gitlab_ci_runner::config_path: "/etc/gitlab-runner/config.toml"
gitlab_ci_runner::package_ensure: "14.5.0"

gitlab_ci_runner::runners:
  "%{::hostname}":
    url: "url"
    registration-token: "token"
    tag-list: "testing"
    ensure: present

gitlab_ci_runner::runner_defaults:
  url: "url"
  registration-token: "token"
  ensure: present

What are you seeing

gitlab-runner can't start, and i got config.toml parsing error.

gitlab-runner[22542]: #033[31;1mFATAL: Service run failed   #033[0;m  #033[31;1merror#033[0;m=Near line 2 (last key parsed ''): bare keys cannot contain '('
gitlab-runner.service: Main process exited, code=exited, status=1/FAILURE
gitlab-runner.service: Failed with result 'exit-code'.

The wrong config.toml rendered by puppet.

# MANAGED BY PUPPET
concurrent = 4
Deferred({'name' => 'gitlab_ci_runner::to_toml', 'arguments' => [{'runners' => [{'url' => 'url', 'executor' => 'docker', 'docker' => {'image' => 'ruby:2.1'}, 'builds_dir' => '/tmp', 'cache_dir' => '/tmp', 'name' => 'gitlab-testing-runner', 'token' => Deferred({'name' => 'gitlab_ci_runner::register_to_file', 'arguments' => ['url', 'token', {'tag_list' => 'testing'}, undef, undef]})}]}]})

What behaviour did you expect instead

I expect gitlab-runner config look like this.

[[runners]]
  name = "gitlab-runner-testing"
  url = "url"
  token = "token"
  executor = "docker"
  builds_dir = "/cache/builds"
  environment = ["DOCKER_DRIVER=overlay2"]
  [runners.custom_build_dir]

Output log

Any additional information you'd like to impart

@dimov-cz
Copy link

dimov-cz commented Apr 7, 2022

I have same issue on new node (Debian Bullseye, puppet-agent 7.26, 6.26).

@dimov-cz
Copy link

dimov-cz commented Apr 7, 2022

Solved for me: Local puppet agent had in config preferred_serialization_format: pson. This is probably incompatible with Deferred, must be json (default option)

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

No branches or pull requests

2 participants