52 lines
1.9 KiB
YAML
52 lines
1.9 KiB
YAML
---
|
|
|
|
- name: (Debian) Get Gitlab repository installation script
|
|
get_url:
|
|
url: "https://packages.gitlab.com/install/repositories/runner/{{ gitlab_runner_package_name }}/script.deb.sh"
|
|
dest: /tmp/gitlab-runner.script.deb.sh
|
|
mode: 0744
|
|
when: gitlab_runner_skip_package_repo_install is not defined or not gitlab_runner_skip_package_repo_install
|
|
|
|
- name: (Debian) Install Gitlab repository
|
|
command: bash /tmp/gitlab-runner.script.deb.sh
|
|
args:
|
|
creates: "/etc/apt/sources.list.d/runner_{{ gitlab_runner_package_name }}.list"
|
|
become: true
|
|
when: gitlab_runner_skip_package_repo_install is not defined or not gitlab_runner_skip_package_repo_install
|
|
|
|
- name: (Debian) Update gitlab_runner_package_name
|
|
set_fact:
|
|
gitlab_runner_package: "{{ gitlab_runner_package_name }}={{ gitlab_runner_package_version }}"
|
|
gitlab_runner_package_state: "present"
|
|
when: gitlab_runner_package_version is defined
|
|
|
|
- name: (Debian) Set gitlab_runner_package_name
|
|
set_fact:
|
|
gitlab_runner_package: "{{ gitlab_runner_package_name }}"
|
|
gitlab_runner_package_state: "latest"
|
|
when: gitlab_runner_package_version is not defined
|
|
|
|
- name: (Debian) Install GitLab Runner
|
|
apt:
|
|
name: "{{ gitlab_runner_package }}"
|
|
state: "{{ gitlab_runner_package_state }}"
|
|
become: true
|
|
environment:
|
|
GITLAB_RUNNER_DISABLE_SKEL: "true"
|
|
when: ansible_distribution_release in ["buster", "focal"]
|
|
|
|
- name: (Debian) Install GitLab Runner
|
|
apt:
|
|
name: "{{ gitlab_runner_package }}"
|
|
state: "{{ gitlab_runner_package_state }}"
|
|
become: true
|
|
when: ansible_distribution_release not in ["buster", "focal"]
|
|
|
|
- name: (Debian) Remove ~/gitlab-runner/.bash_logout on debian buster and ubuntu focal
|
|
file:
|
|
path: /home/gitlab-runner/.bash_logout
|
|
state: absent
|
|
when: ansible_distribution_release in ["buster", "focal"]
|
|
|
|
- name: Set systemd reload options
|
|
import_tasks: systemd-reload.yml
|