Closed yoursweetginger closed 1 year ago
Hm, I'd say (as the error message suggests) the line
content: "{{ lookup('template', 'config.runners.docker.services.j2') if gitlab_runner.docker_services is defined }}"
of the file update-config-runner.yml
in the block:
#### [[runners.docker.services]] section ####
- name: "{{ runn_name_prefix }} Set additional services"
blockinfile:
dest: "{{ temp_runner_config.path }}"
content: "{{ lookup('template', 'config.runners.docker.services.j2') if gitlab_runner.docker_services is defined }}"
state: "{{ 'present' if gitlab_runner.docker_services is defined else 'absent' }}"
marker: "# {mark} runners.docker.services"
insertafter: EOF
check_mode: no
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos
makes the problem. But it is strange because for me I also use shell runners and this is not problematic...
Maybe just adding an else
branch to that if
will sort out the issue, don't you think?
@guenhter
The error was: the inline if-expression on line 1 evaluated to false and no else section was defined
Yes, he's required else section.
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 ;)
There is no condition to not run docker option configuration. It provides to fail tasks when not set docker executor and docker options in vars.