File tree Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,10 @@ reinstall_runner: no
66
66
hide_sensitive_logs : yes
67
67
68
68
# GitHub address
69
- github_server : " https://github.com"
69
+ github_url : " https://github.com"
70
+
71
+ # GitHub API
72
+ github_api_url : " https://api.github.com"
70
73
71
74
# Personal Access Token for your GitHub account
72
75
access_token : " {{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
@@ -77,6 +80,9 @@ runner_org: no
77
80
# Name to assign to this runner in GitHub (System hostname as default)
78
81
runner_name : " {{ ansible_hostname }}"
79
82
83
+ # Custom service name whe usign Github Enterprise server
84
+ # service_name: actions.runner._services.{{ runner_name }}.service
85
+
80
86
# GitHub Repository user or Organization owner used for Runner registration
81
87
# github_account: "youruser"
82
88
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ reinstall_runner: no
21
21
hide_sensitive_logs : yes
22
22
23
23
# GitHub address
24
- github_server : " https://github.com"
24
+ github_url : " https://github.com"
25
+
26
+ # GitHub API
27
+ github_api_url : " https://api.github.com"
25
28
26
29
# Personal Access Token for your GitHub account
27
30
access_token : " {{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
@@ -32,6 +35,9 @@ runner_org: no
32
35
# Name to assign to this runner in GitHub (System hostname as default)
33
36
runner_name : " {{ ansible_hostname }}"
34
37
38
+ # Custom service name whe usign Github Enterprise server
39
+ # service_name: actions.runner._services.{{ runner_name }}.service
40
+
35
41
# GitHub Repository user or Organization owner used for Runner registration
36
42
# github_account: "youruser"
37
43
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : Get registration token (RUN ONCE)
3
3
uri :
4
- url : " https://api.github.com /orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
4
+ url : " {{ github_api_url }} /orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
5
5
headers :
6
6
Authorization : " token {{ access_token }}"
7
7
Accept : " application/vnd.github.v3+json"
16
16
17
17
- name : Check currently registered runners (RUN ONCE)
18
18
uri :
19
- url : " https://api.github.com /orgs/{{ github_owner | default(github_account) }}/actions/runners"
19
+ url : " {{ github_api_url }} /orgs/{{ github_owner | default(github_account) }}/actions/runners"
20
20
headers :
21
21
Authorization : " token {{ access_token }}"
22
22
Accept : " application/vnd.github.v3+json"
38
38
- name : Build service name
39
39
set_fact :
40
40
runner_service : " actions.runner.{{ (github_owner | default(github_account))[:45] }}.{{ runner_name }}.service"
41
+ when : service_name is not defined
42
+ tags :
43
+ - install
44
+ - uninstall
45
+
46
+ - name : Build service name
47
+ set_fact :
48
+ runner_service : " {{ service_name }}"
49
+ when : service_name is defined
41
50
tags :
42
51
- install
43
52
- uninstall
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : Get registration token (RUN ONCE)
3
3
uri :
4
- url : " https://api.github.com /repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
4
+ url : " {{ github_api_url }} /repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
5
5
headers :
6
6
Authorization : " token {{ access_token }}"
7
7
Accept : " application/vnd.github.v3+json"
16
16
17
17
- name : Check currently registered runners (RUN ONCE)
18
18
uri :
19
- url : " https://api.github.com /repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
19
+ url : " {{ github_api_url }} /repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
20
20
headers :
21
21
Authorization : " token {{ access_token }}"
22
22
Accept : " application/vnd.github.v3+json"
45
45
- name : Build service name
46
46
set_fact :
47
47
runner_service : " actions.runner.{{ svc_name[:45] }}.{{ runner_name }}.service"
48
+ when : service_name is not defined
49
+ tags :
50
+ - install
51
+ - uninstall
52
+
53
+ - name : Build service name
54
+ set_fact :
55
+ runner_service : " {{ service_name }}"
56
+ when : service_name is defined
48
57
tags :
49
58
- install
50
59
- uninstall
Original file line number Diff line number Diff line change 14
14
uri :
15
15
url : " https://api.github.com/repos/actions/runner/releases/latest"
16
16
headers :
17
- Authorization : " token {{ access_token }}"
18
- Accept : " application/vnd.github.v3+json"
17
+ Content-Type : " application/json"
19
18
method : GET
20
- force_basic_auth : yes
21
19
return_content : yes
22
20
status_code : 200
23
21
body_format : json
You can’t perform that action at this time.
0 commit comments