Skip to content

Repository files navigation

📃 Role overview

github_runner_setup

Description: Sets up a self-hosted GitHub Actions runner on a Linux machine.

FieldValue
Readme update2026/05/13

Vars

These are variables with higher priority

File: vars/main.yml

VarTypeValue
gh_runner_versionstr2.334.0
runner_directorystr/home/{{ ansible_user }}/.actions-runner
runner_download_urlstrhttps://github.com/actions/runner/releases/download/v{{ gh_runner_version }}/actions-runner-linux-x64-{{ gh_runner_version }}.tar.gz
scopeslist[]
scopes.0strrepository
scopes.1strorganization
gh_runner_archstrx64
gh_scopestrrepository
gh_apistrhttps://api.github.com
gh_api_tokenstr
repo_namestr
gh_ownerstr
gh_orgstr
runner_labelsstrself-hosted,linux
runner_namestr{{ ansible_hostname }}-gha-runner

Tasks

File: tasks/create-registration-token.yml

NameModuleHas Conditions
Check runner scopeansible.builtin.assertFalse
Set runner scope registration URLansible.builtin.set_factFalse
Create GitHub Actions runner registration tokenansible.builtin.uriTrue

File: tasks/download-github-runner-package.yml

NameModuleHas Conditions
Download github runner packageansible.builtin.get_urlTrue
Ensure destination directory existsansible.builtin.fileFalse
Extract github runner packageansible.builtin.unarchiveFalse

File: tasks/install-dependencies.yml

NameModuleHas Conditions
Install the dependencies for the github runneransible.builtin.commandFalse

File: tasks/install-service.yml

NameModuleHas Conditions
Install and start github runner as a systemd serviceblockFalse
Install and start github runner as a systemd serviceansible.builtin.commandFalse

File: tasks/main.yml

NameModuleHas Conditions
Create registration tokenansible.builtin.include_tasksFalse
Download github runner packageansible.builtin.include_tasksFalse
Register the github runner and start the serviceansible.builtin.include_tasksFalse

File: tasks/register-github-runner.yml

NameModuleHas Conditions
Validate and check github runner and start serviceblockFalse
Check if GitHub Actions runner is already configuredansible.builtin.statFalse
Register the github runneransible.builtin.commandTrue
Install and start github runner as a systemd serviceblockFalse
Install the service after a successful registration on the first attemptansible.builtin.include_tasksTrue

Playbook

# SPDX-License-Identifier: GPL-3.0
- hosts: allgather_facts: trueroles:
- github_runner_setup

Author Information

opscontainer

License

GPL-3.0

Minimum Ansible Version

2.20.0

Platforms

  • AlmaLinux: ['all']
  • Ubuntu: ['all']
  • Debian: ['all']

Dependencies

No dependencies specified.

TODO's

  • Pre-commit configuration
  • Github Workflows
  • SBOM
  • Security scanning

Contributing

See the CONTRIB.md guide for contribution instructions.

About

Automates the creation and onboarding of github actions runner on a linux machine

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages