|
@@ -48,13 +48,29 @@
|
|
- debug:
|
|
- debug:
|
|
msg: gitlab-runner arch is {{ gitlab_runner_arch }}
|
|
msg: gitlab-runner arch is {{ gitlab_runner_arch }}
|
|
|
|
|
|
- - name: Download the matching gitlab-runner
|
|
|
|
|
|
+ - name: Download the matching gitlab-runner (DEB)
|
|
get_url:
|
|
get_url:
|
|
dest: "/root/"
|
|
dest: "/root/"
|
|
url: "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_{{ gitlab_runner_arch }}.deb"
|
|
url: "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_{{ gitlab_runner_arch }}.deb"
|
|
|
|
+ when:
|
|
|
|
+ - ansible_facts['distribution'] == 'Ubuntu'
|
|
|
|
+
|
|
|
|
+ - name: Download the matching gitlab-runner (RPM)
|
|
|
|
+ get_url:
|
|
|
|
+ dest: "/root/"
|
|
|
|
+ url: "https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_{{ gitlab_runner_arch }}.rpm"
|
|
|
|
+ when:
|
|
|
|
+ - ansible_facts['distribution'] == 'CentOS'
|
|
|
|
|
|
- - name: Install gitlab-runner via package manager
|
|
|
|
|
|
+ - name: Install gitlab-runner via package manager (DEB)
|
|
apt: deb="/root/gitlab-runner_{{ gitlab_runner_arch }}.deb"
|
|
apt: deb="/root/gitlab-runner_{{ gitlab_runner_arch }}.deb"
|
|
|
|
+ when:
|
|
|
|
+ - ansible_facts['distribution'] == 'Ubuntu'
|
|
|
|
+
|
|
|
|
+ - name: Install gitlab-runner via package manager (RPM)
|
|
|
|
+ yum: name="/root/gitlab-runner_{{ gitlab_runner_arch }}.rpm"
|
|
|
|
+ when:
|
|
|
|
+ - ansible_facts['distribution'] == 'CentOS'
|
|
|
|
|
|
- name: Register the gitlab-runner
|
|
- name: Register the gitlab-runner
|
|
command: "/usr/bin/gitlab-runner register --non-interactive --url {{ gitlab_runner_server_url }} --registration-token {{ gitlab_runner_registration_token }} --executor shell --tag-list {{ ansible_facts[\"architecture\"] }},{{ ansible_facts[\"distribution\"]|lower }}_{{ ansible_facts[\"distribution_version\"] }} --description '{{ ansible_facts[\"distribution\"] }} {{ ansible_facts[\"distribution_version\"] }} {{ ansible_facts[\"architecture\"] }} ({{ ansible_facts[\"os_family\"] }})'"
|
|
command: "/usr/bin/gitlab-runner register --non-interactive --url {{ gitlab_runner_server_url }} --registration-token {{ gitlab_runner_registration_token }} --executor shell --tag-list {{ ansible_facts[\"architecture\"] }},{{ ansible_facts[\"distribution\"]|lower }}_{{ ansible_facts[\"distribution_version\"] }} --description '{{ ansible_facts[\"distribution\"] }} {{ ansible_facts[\"distribution_version\"] }} {{ ansible_facts[\"architecture\"] }} ({{ ansible_facts[\"os_family\"] }})'"
|