Skip to content

Commit

Permalink
Change dir before unregistering
Browse files Browse the repository at this point in the history
When running the unregister command the runner is not detected because gitlab-runner defaults to local user config rather than the central config location.
  • Loading branch information
AJDurant committed Jun 23, 2023
1 parent 52a431c commit 24ac275
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/register-runner-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@

- name: (Windows) Unregister runner when config has changed
win_command: '{{ gitlab_runner_executable }} unregister --name {{ actual_gitlab_runner_name }}'
when:
args:
chdir: "{{ gitlab_runner_config_file_location }}"
when:
- actual_gitlab_runner_name in registered_gitlab_runner_names
- runner_config_state.changed
when: gitlab_runner_config_update_mode == 'by_registering'
Expand All @@ -132,7 +134,7 @@
{% if gitlab_runner.ssh_password is defined %}
--ssh-password '{{ gitlab_runner.ssh_password }}'
{% endif %}
when:
when:
- actual_gitlab_runner_name) not in registered_gitlab_runner_names
- gitlab_runner.state|default('present') == 'present'
args:
Expand Down

0 comments on commit 24ac275

Please sign in to comment.