From b9a3214c2edc37a4396aab45f39e09d9b989082d Mon Sep 17 00:00:00 2001 From: Devan Carpenter Date: Thu, 5 Nov 2020 10:24:20 +0100 Subject: [PATCH] allow for dynamic runner description Previously the Runner description was hard coded. Now it is possible to set it dynamically via an ansible fact. --- roles/gitlab-runner/tasks/main.yml | 2 +- roles/gitlab-runner/templates/gitlab_runner.fact | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/gitlab-runner/tasks/main.yml b/roles/gitlab-runner/tasks/main.yml index 5643980..bfdadd0 100644 --- a/roles/gitlab-runner/tasks/main.yml +++ b/roles/gitlab-runner/tasks/main.yml @@ -29,7 +29,7 @@ body_format: form-urlencoded body: name: "{{ ansible_fqdn }}" - description: "virtual machine on {{ ansible_fqdn }}" + description: "{{ ansible_local.gitlab_runner.description }}" token: "{{ ansible_local.gitlab_runner.registration_token }}" tag_list: "{{ ansible_local.gitlab_runner.tags }}" status_code: 201 diff --git a/roles/gitlab-runner/templates/gitlab_runner.fact b/roles/gitlab-runner/templates/gitlab_runner.fact index ff831c4..d0fcf5b 100644 --- a/roles/gitlab-runner/templates/gitlab_runner.fact +++ b/roles/gitlab-runner/templates/gitlab_runner.fact @@ -3,5 +3,6 @@ "runner_token": "{{ runner_token.content | from_json | json_query('token') }}", "gitlab_domain": "{{ ansible_local.gitlab_runner.gitlab_domain }}", "executor": "{{ ansible_local.gitlab_runner.executor }}", + "description": "{{ ansible_local.gitlab_runner.description }}", "tags": "{{ ansible_local.gitlab_runner.tags }}" }