From 238ba295015ff20856c1f0ca66741e0873a7f3d5 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Tue, 28 Mar 2023 15:07:46 +0200
Subject: [PATCH] Add --docker-image flag to tasks

---
 README.md                                                   | 2 +-
 group_vars/ci_runners.yml                                   | 6 ++++++
 .../{ci-runners.yml.example => ci_runners.yml.example}      | 0
 inventory.yml                                               | 2 +-
 playbook.yml                                                | 2 +-
 roles/gitlab-runner/tasks/main.yml                          | 1 +
 6 files changed, 10 insertions(+), 3 deletions(-)
 create mode 100644 group_vars/ci_runners.yml
 rename group_vars/{ci-runners.yml.example => ci_runners.yml.example} (100%)

diff --git a/README.md b/README.md
index 8fc1e61..42ff3dd 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ your choice.
  2. Get the ip address of the new VM, and configure your ssh environment
  3. Create & activate a python virtual environment and install ansible
  4. Update inventory.yml so that your VM is defined in the "gitlab-runner" group
- 5. Create the file `group_vars/ci-runners.yml` following the [example file](group_vars/ci-runners.yml.example) given
+ 5. Create the file `group_vars/ci_runners.yml` following the [example file](group_vars/ci_runners.yml.example) given
     * Consider the type of executor you want/need (docker, shell, etc.)
         * More info on GitLab runner executors can be found [here](https://docs.gitlab.com/runner/executors/)
     * This requires acquiring an access token to the GitLab instance for which you want to set up a runner
diff --git a/group_vars/ci_runners.yml b/group_vars/ci_runners.yml
new file mode 100644
index 0000000..e37f1f6
--- /dev/null
+++ b/group_vars/ci_runners.yml
@@ -0,0 +1,6 @@
+runner:
+  gitlab_url: 'https://gitlab.geant.org/'
+  git_project_name: 'goat/gap/geant-automation-platform'
+  access_token: 'glpat--JZC9kbyxoRUAyfLSGQz'
+  registration_token: 'GR1348941TaaZFFFhbsT1t91fgjTf'
+  executor: docker
diff --git a/group_vars/ci-runners.yml.example b/group_vars/ci_runners.yml.example
similarity index 100%
rename from group_vars/ci-runners.yml.example
rename to group_vars/ci_runners.yml.example
diff --git a/inventory.yml b/inventory.yml
index 2b6b690..93131c6 100644
--- a/inventory.yml
+++ b/inventory.yml
@@ -1,4 +1,4 @@
-ci-runners:
+ci_runners:
   hosts:
     nat-runner-01:
       ansible_host: nat-runner-01
diff --git a/playbook.yml b/playbook.yml
index ffe8d2e..deb61e6 100644
--- a/playbook.yml
+++ b/playbook.yml
@@ -1,5 +1,5 @@
 - name: Install and set up a GitLab CI runner
-  hosts: ci-runners
+  hosts: ci_runners
   become: true
   roles:
     - gitlab-runner
diff --git a/roles/gitlab-runner/tasks/main.yml b/roles/gitlab-runner/tasks/main.yml
index 997fbf9..b3d3991 100644
--- a/roles/gitlab-runner/tasks/main.yml
+++ b/roles/gitlab-runner/tasks/main.yml
@@ -42,6 +42,7 @@
       - '--url={{ runner.gitlab_url }}'
       - '--token={{ gitlab_authentication_response.runner.token }}'
       - '--executor={{ runner.executor }}'
+      - '--docker-image=alpine:latest'
       - '--non-interactive'
   become: true
   no_log: true
-- 
GitLab