-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from riemers/remove-not-longer-configured-run…
…ners Remove not longer configured runners
- Loading branch information
Showing
11 changed files
with
87 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
- name: Get the names of all configured runner executors | ||
set_fact: | ||
local_gitlab_executor_names: "{{ gitlab_runner_runners | map(attribute='name') | list }}" | ||
|
||
- name: Find all executors which are not longer configured in ansible | ||
set_fact: | ||
available_runners_not_longer_configured: "{{ registered_gitlab_runner_names | difference(local_gitlab_executor_names) }}" | ||
|
||
- name: These runners are going to be unregistered | ||
debug: var=available_runners_not_longer_configured | ||
when: available_runners_not_longer_configured | length > 0 | ||
|
||
- include_tasks: unregister-runner.yml | ||
loop: "{{ available_runners_not_longer_configured }}" | ||
loop_control: | ||
loop_var: actual_gitlab_runner_name | ||
when: available_runners_not_longer_configured | length > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
|
||
|
||
- name: (Container) Unregister runner | ||
docker_container: | ||
name: "{{ gitlab_runner_container_name }}-list" | ||
image: "{{ gitlab_runner_container_image }}:{{ gitlab_runner_container_tag }}" | ||
command: unregister --name {{ actual_gitlab_runner_name }}' | ||
mounts: | ||
- type: bind | ||
source: "{{ gitlab_runner_container_mount_path }}" | ||
target: /etc/gitlab-runner | ||
cleanup: yes | ||
interactive: yes | ||
tty: yes | ||
detach: no | ||
changed_when: False | ||
check_mode: no | ||
when: | ||
- gitlab_install_target_platform == 'container' | ||
|
||
|
||
- name: (Windows) Unregister runner | ||
win_command: '{{ gitlab_runner_executable }} unregister --name {{ actual_gitlab_runner_name }}' | ||
args: | ||
chdir: "{{ gitlab_runner_config_file_location }}" | ||
when: | ||
- gitlab_install_target_platform == 'windows' | ||
|
||
|
||
- name: Unregister runner | ||
ansible.builtin.command: '{{ gitlab_runner_executable }} unregister --name {{ actual_gitlab_runner_name }}' | ||
when: | ||
- gitlab_install_target_platform == 'unix' |