Skip to content
Snippets Groups Projects
Verified Commit 4c22e66e 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 40494471
No related branches found
No related tags found
No related merge requests found
runner: runner:
gitlab_url: 'https://gitlab.geant.org/' gitlab_url: 'https://gitlab.geant.org/'
git_project_name: 'nat/gap'
access_token: xxx access_token: xxx
registration_token: xxx registration_token: xxx
runner_tags: executor: shell
- gap
- nat
ci-runners: ci-runners:
hosts: hosts:
test-nat-ci01: nat-runner-01:
ansible_host: ansible_host: nat-runner-01
test-nat-ci01
...@@ -18,17 +18,30 @@ ...@@ -18,17 +18,30 @@
ansible.builtin.pip: ansible.builtin.pip:
name: python-gitlab name: python-gitlab
- name: Register runner - name: Request runner token
no_log: true
community.general.gitlab_runner: community.general.gitlab_runner:
api_url: '{{ runner.gitlab_url }}' api_url: '{{ runner.gitlab_url }}'
api_token: '{{ runner.access_token }}' api_token: '{{ runner.access_token }}'
registration_token: '{{ runner.registration_token }}' registration_token: '{{ runner.registration_token }}'
description: '{{ inventory_hostname_short }}' description: '{{ inventory_hostname_short }}'
project: 'nat/gap' project: '{{ runner.git_project_name }}'
state: present state: present
tag_list: '{{ runner.runner_tags + [inventory_hostname_short] }}' tag_list: '{{ runner.executor }}-executor'
run_untagged: false run_untagged: false
locked: true locked: true
access_level_on_creation: true access_level_on_creation: true
access_level: 'not_protected' 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