Skip to content

Custom runner #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ runner_name: "{{ ansible_hostname }}"
# Labels to apply to the runner
runner_labels: []

# GitHub repository where releases will be downloaded from
runner_download_repository: "actions/runner"

# extra arguments to pass to `config.sh`
runner_extra_config_args: ""

# Custom service name when usign Github Enterprise server
# service_name: actions.runner._services.{{ runner_name }}.service

Expand Down
7 changes: 4 additions & 3 deletions tasks/install_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- name: Find the latest runner version (RUN ONCE)
uri:
url: "https://api.github.com/repos/actions/runner/releases/latest"
url: "https://api.github.com/repos/{{ runner_download_repository }}/releases/latest"
headers:
Content-Type: "application/json"
method: GET
Expand Down Expand Up @@ -54,7 +54,7 @@

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

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