Skip to content
Snippets Groups Projects
Commit 52b8522a authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Update: will now register runner using non-deprecated token method

parent 540c3975
No related branches found
No related tags found
No related merge requests found
runner:
gitlab_url: 'https://gitlab.geant.org/'
git_project_name: 'nat/gap'
access_token: xxx
registration_token: xxx
runner_tags:
- gap
- nat
executor: shell
ci-runners:
hosts:
test-nat-ci01:
ansible_host:
test-nat-ci01
nat-runner-01:
ansible_host: nat-runner-01
......@@ -18,17 +18,30 @@
ansible.builtin.pip:
name: python-gitlab
- name: Register runner
no_log: true
- name: Request runner token
community.general.gitlab_runner:
api_url: '{{ runner.gitlab_url }}'
api_token: '{{ runner.access_token }}'
registration_token: '{{ runner.registration_token }}'
description: '{{ inventory_hostname_short }}'
project: 'nat/gap'
project: '{{ runner.git_project_name }}'
state: present
tag_list: '{{ runner.runner_tags + [inventory_hostname_short] }}'
tag_list: '{{ runner.executor }}-executor'
run_untagged: false
locked: true
access_level_on_creation: true
access_level: 'not_protected'
no_log: true
register: gitlab_authentication_response
- name: Register GitLab
ansible.builtin.command:
argv:
- gitlab-runner
- register
- '--url={{ runner.gitlab_url }}'
- '--token={{ gitlab_authentication_response.runner.token }}'
- '--executor={{ runner.executor }}'
- '--non-interactive'
become: true
no_log: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment