First of all thank you for making this great Ansible role! Unfortunately, I ran into the issue described below. I have spent quite a considerable time looking into the code of the role, but have not been able to resolve it. I hope that you can help me.
I am having trouble to setup a Docker-in-Docker configuration using the Ansible Gitlab-runner role, where one configuration works for the first configuration (below; which does not contain all needed settings), but fails for a very similar one (second example below, which contains all needed settings). Please see the section Error description for details. Thank you in advance.
This is the failing configuration, where I uncommented lines at the bottom. This causes the Ansible role to fail:
gitlab_runner_container_install: true
gitlab_runner_container_image: gitlab/gitlab-runner
gitlab_runner_container_tag: v16.9.1
gitlab_runner_container_name: gitlab-runner
# config-directory that is mounted into the container and store the config.toml
gitlab_runner_container_mount_path: "/etc/gitlab-runner"
gitlab_runner_runners:
- name: "gitlab_runner_1"
description: "Project: gitlab-runner-dind-tutorial"
state: present
url: "{{ gitlab_url }}"
token: "{{ gitlab_prj_token__gitlab_runner_dind_tutorial }}"
executor: docker
docker_image: "docker:stable"
docker_privileged: true
docker_tlsverify: true
docker_volumes:
- "/certs/client"
- "/cache"
It will not create a working config.toml and also not register the runner with the Gitlab instance. This is the failing config.toml file that is produced by this configuration (yes, it only contains this single line):
session_timeout = 1800
Notably, I can run the first example first, then uncomment the lines (like in the second configuration) and this will correctly update the previously created runner. This is the config.toml file after updating it as just described (this works as expected with my Docker-in-Docker pipeline):
Seems this message did not get a lot of love. This does not mean it was not seen but time wise might not have made it to proper attention. This is just the clean up action ;)
Intro
First of all thank you for making this great Ansible role! Unfortunately, I ran into the issue described below. I have spent quite a considerable time looking into the code of the role, but have not been able to resolve it. I hope that you can help me.
I am having trouble to setup a Docker-in-Docker configuration using the Ansible Gitlab-runner role, where one configuration works for the first configuration (below; which does not contain all needed settings), but fails for a very similar one (second example below, which contains all needed settings). Please see the section Error description for details. Thank you in advance.
Info about the environment
Ansible version:
Gitlab-runner role version:
Playbook
Content of
vars/gitlab_runners.yml
is shown in the following sectionError description
This is the working configuration, which correctly adds the Docker runner and configures it in the
config.toml
file:This is the corresponding
config.toml
file that is create:This is the failing configuration, where I uncommented lines at the bottom. This causes the Ansible role to fail:
It will not create a working
config.toml
and also not register the runner with the Gitlab instance. This is the failingconfig.toml
file that is produced by this configuration (yes, it only contains this single line):Notably, I can run the first example first, then uncomment the lines (like in the second configuration) and this will correctly update the previously created runner. This is the
config.toml
file after updating it as just described (this works as expected with my Docker-in-Docker pipeline):Note:
Before rerunning the examples above, I reset the Gitlab runner host using this script and also remove the runner manually from the Gitlab instance:
This reliably works for the first example and reliably fails for the second example.