homeserver/roles/riemers.gitlab-runner/tasks/install-redhat.yml

39 lines
1.4 KiB
YAML
Raw Normal View History

2021-02-13 14:20:18 +01:00
---
- name: (RedHat) Get Gitlab repository installation script
get_url:
url: "https://packages.gitlab.com/install/repositories/runner/{{ gitlab_runner_package_name }}/script.rpm.sh"
dest: /tmp/gitlab-runner.script.rpm.sh
mode: 0744
when: gitlab_runner_skip_package_repo_install is not defined or not gitlab_runner_skip_package_repo_install
- name: (RedHat) Install Gitlab repository
shell: >
os=el dist={{ '7' if ansible_distribution_major_version | int == 8 else ansible_distribution_major_version }}
bash /tmp/gitlab-runner.script.rpm.sh
args:
creates: "/etc/yum.repos.d/runner_{{ gitlab_runner_package_name }}.repo"
become: true
when: gitlab_runner_skip_package_repo_install is not defined or not gitlab_runner_skip_package_repo_install
- name: (RedHat) 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: (RedHat) 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: (RedHat) Install GitLab Runner
package:
name: "{{ gitlab_runner_package }}"
state: "{{ gitlab_runner_package_state }}"
become: true
- name: Set systemd reload options
import_tasks: systemd-reload.yml