Skip to content

Commit d1b318a

Browse files
Merge pull request #78 from M1cha/custom-runner
Custom runner
2 parents 3c264a9 + 46a8e0b commit d1b318a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ runner_name: "{{ ansible_hostname }}"
3838
# Labels to apply to the runner
3939
runner_labels: []
4040

41+
# GitHub repository where releases will be downloaded from
42+
runner_download_repository: "actions/runner"
43+
44+
# extra arguments to pass to `config.sh`
45+
runner_extra_config_args: ""
46+
4147
# Custom service name when usign Github Enterprise server
4248
# service_name: actions.runner._services.{{ runner_name }}.service
4349

tasks/install_runner.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- name: Find the latest runner version (RUN ONCE)
1313
uri:
14-
url: "https://api.github.com/repos/actions/runner/releases/latest"
14+
url: "https://api.github.com/repos/{{ runner_download_repository }}/releases/latest"
1515
headers:
1616
Content-Type: "application/json"
1717
method: GET
@@ -54,7 +54,7 @@
5454

5555
- name: Download runner package version - "{{ runner_version }}" (RUN ONCE)
5656
get_url:
57-
url: "https://github.com/actions/runner/releases/download/v{{ runner_version }}/\
57+
url: "https://github.com/{{ runner_download_repository }}/releases/download/v{{ runner_version }}/\
5858
actions-runner-linux-{{ github_actions_architecture }}-{{ runner_version }}.tar.gz"
5959
dest: "{{ runner_pkg_tempdir }}/actions-runner-linux-{{ runner_version }}.tar.gz"
6060
force: no
@@ -77,7 +77,8 @@
7777

7878
- name: Register runner (if new installation) for repo
7979
command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \
80-
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended"
80+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended \
81+
{{ runner_extra_config_args }}"
8182
args:
8283
chdir: "{{ runner_dir }}"
8384
become: yes

0 commit comments

Comments
 (0)