Skip to content

Commit 506d6db

Browse files
Edit README
1 parent e0c35ce commit 506d6db

File tree

4 files changed

+9
-38
lines changed

4 files changed

+9
-38
lines changed

README.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This role will deploy/redeploy/uninstall and register/unregister local GitHub Ac
1212

1313
* System must have access to the GitHub.
1414

15-
* The role require Personal Access Token for the GitHub user. The token has to be a value of `PERSONAL_ACCESS_TOKEN` variable.
15+
* The role require Personal Access Token to access the Github Repository. The token has to be a value of `PERSONAL_ACCESS_TOKEN` variable.
1616
Export the token to the local host environment. The token has to have admin rights for the repo.
1717
Personal Access Token for GitHub account can be created [here](https://github.com/settings/tokens).
1818
**Note:** Never store you personal access token in the GitHub repository. Use [GitHub Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) or some different secrets service.
@@ -57,12 +57,9 @@ github_server: "https://github.com"
5757
# Personal Access Token for your GitHub account
5858
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
5959

60-
# GitHub access account
60+
# GitHub Repository user or Organization owner used for Runner registration
6161
# github_account: "youruser"
6262

63-
# GitHub Organization owner or Repository admin used for Runner registration (can be omitted if it is the same as "github_account")
64-
# github_owner: "owneruser"
65-
6663
# Github repository name
6764
# github_repo: "yourrepo"
6865
```
@@ -85,24 +82,7 @@ Runner service will run under the same user as the Ansible is using for ssh conn
8582
- role: monolithprojects.github_actions_runner
8683
```
8784
88-
In this example the Ansible role will deploy (or redeploy) the GitHub Actions runner service. The Ansible will access the GitHub using the `github_account` and register the runner to the GitHub Organization Repository using the Repository admin user (or Organization owner) `github_owner`.
89-
Runner service will run under the same user as the Ansible is using for ssh connection (*ansible*).
90-
91-
```yaml
92-
---
93-
- name: GitHub Actions Runner
94-
hosts: all
95-
user: ansible
96-
become: yes
97-
vars:
98-
- github_account: github-access-user
99-
- github_owner: github-repo-admin
100-
- github_repo: my_awesome_repo
101-
roles:
102-
- role: monolithprojects.github_actions_runner
103-
```
104-
105-
In this example the Ansible role will deploy (or redeploy) the GitHub Actions runner service (version 2.165.2) and register the runner for the GitHub repo. Runner service will run under the used `runner-user`.
85+
In this example the Ansible role will deploy (or redeploy) the GitHub Actions runner service (version 2.165.2) and register the runner for the GitHub repo. Runner service will run under the user `runner-user`.
10686

10787
```yaml
10888
---

defaults/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ github_server: "https://github.com"
2020
# Personal Access Token for your GitHub account
2121
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
2222

23-
# GitHub access account
23+
# GitHub Repository user or Organization owner used for Runner registration
2424
# github_account: "youruser"
2525

26-
# GitHub Organization owner or Repository admin used for Runner registration (can be omited if it is the same as "github_account")
27-
# github_owner: "owneruser"
28-
2926
# Github repository name
3027
# github_repo: "yourrepo"

tasks/collect_info.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
22
- name: Get registration token (RUN ONCE)
33
uri:
4-
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
5-
# user: ""
6-
# password: "{{ access_token }}"
4+
url: "https://api.github.com/repos/{{ github_account }}/{{ github_repo }}/actions/runners/registration-token"
75
headers:
86
Authorization: "token {{ access_token }}"
9-
Accept: application/vnd.github.v3+json""
7+
Accept: "application/vnd.github.v3+json"
108
method: POST
119
status_code: 201
1210
force_basic_auth: yes
@@ -18,12 +16,10 @@
1816

1917
- name: Check currently registered runners (RUN ONCE)
2018
uri:
21-
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
22-
# user: ""
23-
# password: "{{ access_token }}"
19+
url: "https://api.github.com/repos/{{ github_account }}/{{ github_repo }}/actions/runners"
2420
headers:
2521
Authorization: "token {{ access_token }}"
26-
Accept: application/vnd.github.v3+json""
22+
Accept: "application/vnd.github.v3+json"
2723
method: GET
2824
status_code: 200
2925
force_basic_auth: yes

tasks/install_runner.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
- name: Find the latest runner version (RUN ONCE)
1414
uri:
1515
url: "https://api.github.com/repos/actions/runner/releases/latest"
16-
# url_username: " "
17-
# url_password: "{{ access_token }}"
1816
headers:
1917
Authorization: "token {{ access_token }}"
20-
Accept: application/vnd.github.v3+json""
18+
Accept: "application/vnd.github.v3+json"
2119
method: GET
2220
force_basic_auth: yes
2321
return_content: yes

0 commit comments

Comments
 (0)