File tree 17 files changed +124
-291
lines changed
17 files changed +124
-291
lines changed Original file line number Diff line number Diff line change 16
16
fail-fast : true
17
17
steps :
18
18
- name : checkout
19
- uses : actions/checkout@v2
19
+ uses : actions/checkout@v3
20
20
with :
21
21
path : " ${{ github.repository }}"
22
22
- name : Molecule for Ansible - lint
Original file line number Diff line number Diff line change 33
33
tag : " latest"
34
34
steps :
35
35
- name : checkout
36
- uses : actions/checkout@v2
36
+ uses : actions/checkout@v3
37
37
with :
38
38
path : " ${{ github.repository }}"
39
39
- name : Molecule for Ansible - GHR Repository
53
53
fail-fast : false
54
54
steps :
55
55
- name : checkout
56
- uses : actions/checkout@v2
56
+ uses : actions/checkout@v3
57
57
with :
58
58
path : " ${{ github.repository }}"
59
59
- name : Molecule for Ansible - GHR Organization
Original file line number Diff line number Diff line change @@ -51,10 +51,6 @@ runner_name: "{{ ansible_hostname }}"
51
51
# Will the runner be deployed on Github Enterprise server?
52
52
runner_on_ghes : no
53
53
54
- # Custom service name when using Github Enterprise server
55
- # DEPRECATED: this variable is deprecated in favor of "runner_on_ghes" and will be removed in release 1.15.
56
- # service_name: actions.runner._services.{{ runner_name }}.service
57
-
58
54
# GitHub Repository user or Organization owner used for Runner registration
59
55
# github_account: "youruser"
60
56
Original file line number Diff line number Diff line change 3
3
- name : Restart runner service
4
4
service :
5
5
name : " {{ runner_service }}"
6
- state : restarted
6
+ state : restarted
Original file line number Diff line number Diff line change 8
8
- github_repo : ansible-github_actions_runner-testrepo
9
9
- github_account : monolithprojects-testorg
10
10
- runner_state : absent
11
+ - runner_name : test_name
11
12
roles :
12
13
- ansible-github_actions_runner
Original file line number Diff line number Diff line change 8
8
- runner_user : ansible
9
9
- github_repo : ansible-github_actions_runner-testrepo
10
10
- github_account : monolithprojects-testorg
11
- - runner_version : " latest"
12
- - service_name : awesome
11
+ - runner_version : latest
12
+ - runner_name : test_name
13
+ - runner_on_ghes : yes
14
+ - reinstall_runner : false
15
+ - hide_sensitive_logs : no
13
16
- runner_labels :
14
17
- label1
15
18
- repo-runner
Original file line number Diff line number Diff line change 8
8
- github_account : monolithprojects-testorg
9
9
- runner_org : yes
10
10
- runner_state : " stopped"
11
- - runner_version : " 2.274.2 "
11
+ - runner_version : " 2.287.0 "
12
12
roles :
13
13
- robertdebock.epel
14
- - ansible-github_actions_runner
14
+ - ansible-github_actions_runner
Original file line number Diff line number Diff line change 9
9
- github_account : monolithprojects-testorg
10
10
- runner_state : absent
11
11
roles :
12
- - ansible-github_actions_runner
12
+ - ansible-github_actions_runner
Original file line number Diff line number Diff line change 9
9
- github_repo : ansible-github_actions_runner-testrepo
10
10
- github_account : monolithprojects-testorg
11
11
- runner_version : " latest"
12
- - runner_labels :
12
+ - runner_labels :
13
13
- label1
14
14
- repo-runner
15
15
roles :
16
16
- robertdebock.epel
17
- - ansible-github_actions_runner
17
+ - ansible-github_actions_runner
Original file line number Diff line number Diff line change 5
5
- github_account is defined
6
6
fail_msg : " github_account is not defined"
7
7
run_once : yes
8
- tags :
9
- - install
10
- - uninstall
11
8
12
9
- name : Check access_token variable (RUN ONCE)
13
10
assert :
16
13
- access_token | length > 0
17
14
fail_msg : " access_token was not found or is using an invalid format."
18
15
run_once : yes
19
- tags :
20
- - install
21
- - uninstall
22
16
23
17
- name : Check runner_org variable (RUN ONCE)
24
18
assert :
25
19
that :
26
20
- runner_org == True or runner_org == False
27
21
fail_msg : " runner_org should be a boolean value"
28
22
run_once : yes
29
- tags :
30
- - install
31
- - uninstall
32
-
33
- - name : GHES service_name deprecation check (RUN ONCE)
34
- assert :
35
- that :
36
- - service_name is not defined
37
- fail_msg : ' [DEPRECATION WARNING]: Variable "service_name" will is deprecated and will be removed in release 1.15. Start using "running_on_ghes" boolean variable.'
38
- ignore_errors : yes
39
- run_once : yes
40
- tags :
41
- - install
42
- - uninstall
Original file line number Diff line number Diff line change
1
+ ---
2
+ - block :
3
+ - name : Set complete API url for repo runner
4
+ set_fact :
5
+ github_full_api_url : " {{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
6
+ when : not runner_org
7
+
8
+ - name : Set complete API url for org runner
9
+ set_fact :
10
+ github_full_api_url : " {{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
11
+ when : runner_org | bool
12
+
13
+ - name : Get registration token (RUN ONCE)
14
+ uri :
15
+ url : " {{ github_full_api_url }}/registration-token"
16
+ headers :
17
+ Authorization : " token {{ access_token }}"
18
+ Accept : " application/vnd.github.v3+json"
19
+ method : POST
20
+ status_code : 201
21
+ force_basic_auth : yes
22
+ register : registration
23
+ run_once : yes
24
+
25
+ - name : Check currently registered runners for repo (RUN ONCE)
26
+ uri :
27
+ url : " {{ github_full_api_url }}"
28
+ headers :
29
+ Authorization : " token {{ access_token }}"
30
+ Accept : " application/vnd.github.v3+json"
31
+ method : GET
32
+ status_code : 200
33
+ force_basic_auth : yes
34
+ register : registered_runners
35
+ run_once : yes
36
+
37
+ - name : Check service facts
38
+ service_facts :
39
+
40
+ check_mode : false
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
state : present
13
13
update_cache : yes
14
14
when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "9")
15
- tags :
16
- - install
17
15
18
16
- name : Install dependencies on Debian Buster
19
17
package :
27
25
state : present
28
26
update_cache : yes
29
27
when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "10")
30
- tags :
31
- - install
32
28
33
29
- name : Install dependencies on Debian Bullseye
34
30
package :
42
38
state : present
43
39
update_cache : yes
44
40
when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "11")
45
- tags :
46
- - install
47
41
48
42
- name : Install dependencies on Ubuntu Xenial systems
49
43
package :
57
51
state : present
58
52
update_cache : yes
59
53
when : (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16")
60
- tags :
61
- - install
62
54
63
55
- name : Install dependencies on Ubuntu Bionic systems
64
56
package :
72
64
state : present
73
65
update_cache : yes
74
66
when : (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18")
75
- tags :
76
- - install
77
67
78
68
- name : Install dependencies on Ubuntu Focal systems
79
69
package :
87
77
state : present
88
78
update_cache : yes
89
79
when : (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "20")
90
- tags :
91
- - install
92
80
93
81
- name : Install dependencies on RHEL/CentOS/Fedora systems
94
82
package :
105
93
(ansible_distribution == "CentOS") or
106
94
(ansible_distribution == "Fedora") or
107
95
(ansible_distribution == "Rocky")
108
- tags :
109
- - install
You can’t perform that action at this time.
0 commit comments