11GitHub Actions Runner
22=========
33
4- <a href =" https://galaxy.ansible.com/monolithprojects/system_update " ><img src =" https://img.shields.io/ansible/quality/47118?style=flat&logo=ansible " /></a >
5- <a href =" https://galaxy.ansible.com/monolithprojects/system_update " ><img src =" https://img.shields.io/ansible/role/d/47118 " /></a >
4+ <a href =" https://galaxy.ansible.com/monolithprojects/ansible-github_actions_runner " ><img src =" https://img.shields.io/ansible/quality/47118?style=flat&logo=ansible " /></a >
5+ <a href =" https://galaxy.ansible.com/monolithprojects/ansible-github_actions_runner " ><img src =" https://img.shields.io/ansible/role/d/47118 " /></a >
6+ <a href =" https://galaxy.ansible.com/monolithprojects/github_actions_runner " ><img src =" https://img.shields.io/github/v/release/MonolithProjects/github_actions_runner " /></a >
7+ <a href =" https://github.com/MonolithProjects/ansible-github_actions_runner/actions " ><img src =" https://github.com/MonolithProjects/ansible-github_actions_runner/workflows/molecule%20test/badge.svg?branch=master " /></a >
68<a href =" https://github.com/MonolithProjects/ansible-github_actions_runner/blob/master/LICENSE " ><img src =" https://img.shields.io/github/license/MonolithProjects/ansible-github_actions_runner " /></a >
79
8- This role will deploy local GitHub Actions Runner.
10+ This role will deploy or redeploy or uninstall and register or unregister local GitHub Actions Runner (version you specified) .
911
10- ** Note:**
11- The role is in early development stage.
12- Role is able to:
13- - install and cofigure local runner
14- - request reistration token
15- - register the runner to GitHub
16-
17- Currently is missing:
18- - idempotency
19- - runner unregistration
20- - automated testing
2112
2213Requirements
2314------------
2415
25- System must have access to the packages repository (Internet, Red Hat Satellite, etc.) .
16+ System must have access to the GitHub .
2617
2718CentOS/Fedora systems require EPEL repository.
2819
29- ` PERSONAL_ACCESS_TOKEN ` variable needs to be exported to your environment.
20+ ` PERSONAL_ACCESS_TOKEN ` variable needs to be exported to your environment. The token has to have admin rights for the repo.
21+ Personal Access Token for your GitHub account can be created [ here] ( https://github.com/settings/tokens ) .
3022
3123Role Variables
3224--------------
@@ -35,11 +27,17 @@ This is a copy from `defaults/main.yml`
3527
3628``` yaml
3729# Directory where the local runner will be installed
38- runner_dir : " /opt/actions-runner"
30+ runner_dir : /opt/actions-runner
3931
4032# Version of the GitHub Actions Runner
4133runner_version : " 2.165.2"
4234
35+ # If found, replace already registered runner
36+ replace_runner : yes
37+
38+ # Do not show Ansible logs which may contain sensitive data (registration token)
39+ hide_sensitive_logs : yes
40+
4341# Personal Access Token for your GitHub account
4442access_token : " {{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
4543
@@ -53,24 +51,47 @@ github_server: "https://github.com"
5351# github_repo: "yourrepo"
5452```
5553
54+
5655Example Playbook
5756----------------
5857
59- Simple example.
58+ In this example the role will deploy (or redeploy) the GitHub Actions runner service (default version ins ) and register the runner for the GitHub repo.
59+
60+ ``` yaml
61+ ---
62+ - name : GitHub Actions Runner
63+ hosts : all
64+ become : yes
65+ vars :
66+ - runner_version : " 2.165.2"
67+ - runner_user : runner
68+ - github_account : myuser
69+ - github_repo : my_awesome_repo
70+ roles :
71+ - role : monolithprojects.github_actions_runner
72+ ` ` `
6073
74+ Here the GitHub Actions runners will be uninstalled, service stopped and unregistered from the GitHub.
6175` ` ` yaml
6276---
63- - name : Converge
77+ - name : GitHub Actions Runner
6478 hosts : all
6579 become : yes
80+ tags :
81+ - uninstall
6682 vars :
83+ - runner_version : " 2.165.2"
6784 - runner_user : runner
68- - github_account : example
69- - github_repo : example
85+ - github_account : myuser
86+ - github_repo : my_awesome_repo
7087 roles :
71- - role : monolithprojects/ github_actions_runner
88+ - role : monolithprojects. github_actions_runner
7289` ` `
7390
91+ ToDo
92+ ----
93+ Full Debian/Ubuntu support
94+
7495License
7596-------
7697
0 commit comments