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
6666hide_sensitive_logs : yes
6767
6868# 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"
7073
7174# Personal Access Token for your GitHub account
7275access_token : " {{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
@@ -77,6 +80,9 @@ runner_org: no
7780# Name to assign to this runner in GitHub (System hostname as default)
7881runner_name : " {{ ansible_hostname }}"
7982
83+ # Custom service name whe usign Github Enterprise server
84+ # service_name: actions.runner._services.{{ runner_name }}.service
85+
8086# GitHub Repository user or Organization owner used for Runner registration
8187# github_account: "youruser"
8288
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ reinstall_runner: no
2121hide_sensitive_logs : yes
2222
2323# 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"
2528
2629# Personal Access Token for your GitHub account
2730access_token : " {{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
@@ -32,6 +35,9 @@ runner_org: no
3235# Name to assign to this runner in GitHub (System hostname as default)
3336runner_name : " {{ ansible_hostname }}"
3437
38+ # Custom service name whe usign Github Enterprise server
39+ # service_name: actions.runner._services.{{ runner_name }}.service
40+
3541# GitHub Repository user or Organization owner used for Runner registration
3642# github_account: "youruser"
3743
Original file line number Diff line number Diff line change 11---
22- name : Get registration token (RUN ONCE)
33 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"
55 headers :
66 Authorization : " token {{ access_token }}"
77 Accept : " application/vnd.github.v3+json"
1616
1717- name : Check currently registered runners (RUN ONCE)
1818 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"
2020 headers :
2121 Authorization : " token {{ access_token }}"
2222 Accept : " application/vnd.github.v3+json"
3838- name : Build service name
3939 set_fact :
4040 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
4150 tags :
4251 - install
4352 - uninstall
Original file line number Diff line number Diff line change 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"
4+ url : " {{ github_api_url }} /repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
55 headers :
66 Authorization : " token {{ access_token }}"
77 Accept : " application/vnd.github.v3+json"
1616
1717- name : Check currently registered runners (RUN ONCE)
1818 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"
2020 headers :
2121 Authorization : " token {{ access_token }}"
2222 Accept : " application/vnd.github.v3+json"
4545- name : Build service name
4646 set_fact :
4747 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
4857 tags :
4958 - install
5059 - uninstall
Original file line number Diff line number Diff line change 1414 uri :
1515 url : " https://api.github.com/repos/actions/runner/releases/latest"
1616 headers :
17- Authorization : " token {{ access_token }}"
18- Accept : " application/vnd.github.v3+json"
17+ Content-Type : " application/json"
1918 method : GET
20- force_basic_auth : yes
2119 return_content : yes
2220 status_code : 200
2321 body_format : json
You can’t perform that action at this time.
0 commit comments