File tree 10 files changed +93
-20
lines changed
10 files changed +93
-20
lines changed Original file line number Diff line number Diff line change 1
- actions-runner-linux- *
1
+ * .gz
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Requirements
14
14
15
15
* Supported Linux distros:
16
16
* CentOS/RHEL 7,8
17
+ * Debian 9,10
17
18
* Fedora 16+
18
19
* Ubuntu 16,18
19
20
@@ -34,14 +35,14 @@ Role Variables
34
35
This is a copy from ` defaults/main.yml `
35
36
36
37
``` yaml
37
- # Runner user - user inder which is the local runner service running
38
+ # Runner user - user under which is the local runner service running
38
39
runner_user : runner
39
40
40
41
# Directory where the local runner will be installed
41
42
runner_dir : /opt/actions-runner
42
43
43
44
# Version of the GitHub Actions Runner
44
- runner_version : " 2.165.2 "
45
+ runner_version : " latest "
45
46
46
47
# If found, replace already registered runner
47
48
replace_runner : yes
@@ -65,7 +66,7 @@ github_server: "https://github.com"
65
66
Example Playbook
66
67
----------------
67
68
68
- 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.
69
+ In this example the role will deploy (or redeploy) the GitHub Actions runner service (version 2.165.2 ) and register the runner for the GitHub repo.
69
70
70
71
``` yaml
71
72
---
@@ -74,7 +75,7 @@ In this example the role will deploy (or redeploy) the GitHub Actions runner ser
74
75
become : yes
75
76
vars :
76
77
- runner_version : " 2.165.2"
77
- - runner_user : runner
78
+ - runner_user : ansible
78
79
- github_account : myuser
79
80
- github_repo : my_awesome_repo
80
81
roles :
Original file line number Diff line number Diff line change 1
1
---
2
- # Runner user - user inder which is the local runner service running
2
+ # Runner user - user under which is the local runner service running
3
3
runner_user : runner
4
4
5
5
# Directory where the local runner will be installed
6
6
runner_dir : /opt/actions-runner
7
7
8
8
# Version of the GitHub Actions Runner
9
- runner_version : " 2.165.2 "
9
+ runner_version : " latest "
10
10
11
11
# If found, replace already registered runner
12
12
replace_runner : yes
Original file line number Diff line number Diff line change 14
14
- name : Fedora
15
15
versions :
16
16
- all
17
- # - name: Debian
18
- # versions:
19
- # - jessie
20
- # - stretch
17
+ - name : Debian
18
+ versions :
19
+ - buster
20
+ - stretch
21
21
- name : Ubuntu
22
22
versions :
23
23
- xenial
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
hosts : all
5
5
become : yes
6
6
vars :
7
+ - runner_version : " 2.168.0"
7
8
- runner_user : ansible
8
9
- github_repo : ansible-github_actions_runner-testrepo
9
10
- github_account : monolithprojects
Original file line number Diff line number Diff line change @@ -44,6 +44,26 @@ platforms:
44
44
- /sys/fs/cgroup:/sys/fs/cgroup:ro
45
45
privileged : yes
46
46
pre_build_image : yes
47
+ - name : Debian9
48
+ image : monolithprojects/systemd-debian9:latest
49
+ command : /sbin/init
50
+ tmpfs :
51
+ - /run
52
+ - /tmp
53
+ volumes :
54
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
55
+ privileged : yes
56
+ pre_build_image : yes
57
+ - name : Debian10
58
+ image : monolithprojects/systemd-debian10:latest
59
+ command : /sbin/init
60
+ tmpfs :
61
+ - /run
62
+ - /tmp
63
+ volumes :
64
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
65
+ privileged : yes
66
+ pre_build_image : yes
47
67
provisioner :
48
68
name : ansible
49
69
playbooks :
Original file line number Diff line number Diff line change 1
1
---
2
- - name : Install dependencies on Debian Stretch / Ubuntu Xenial systems
2
+ - name : Install dependencies on Debian Stretch
3
+ package :
4
+ pkg :
5
+ - liblttng-ust0
6
+ - libkrb5-3
7
+ - zlib1g
8
+ - libssl1.1
9
+ - libicu57
10
+ state : present
11
+ update_cache : yes
12
+ when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "9")
13
+ tags :
14
+ - install
15
+
16
+ - name : Install dependencies on Debian Buster
17
+ package :
18
+ pkg :
19
+ - liblttng-ust0
20
+ - libkrb5-3
21
+ - zlib1g
22
+ - libssl1.1
23
+ - libicu63
24
+ state : present
25
+ update_cache : yes
26
+ when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "10")
27
+ tags :
28
+ - install
29
+
30
+ - name : Install dependencies on Ubuntu Xenial systems
3
31
package :
4
32
pkg :
5
33
- liblttng-ust0
9
37
- libicu55
10
38
state : present
11
39
update_cache : yes
12
- when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "9") or
13
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16")
40
+ when : (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16")
14
41
tags :
15
42
- install
16
43
17
- - name : Install dependencies on Debian Buster / Ubuntu Bionic systems
44
+ - name : Install dependencies on Ubuntu Bionic systems
18
45
package :
19
46
pkg :
20
47
- liblttng-ust0
24
51
- libicu60
25
52
state : present
26
53
update_cache : yes
27
- when : (ansible_distribution == "Debian" and ansible_distribution_major_version == "10") or
28
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18")
54
+ when : (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18")
29
55
tags :
30
56
- install
31
57
Original file line number Diff line number Diff line change 10
10
tags :
11
11
- install
12
12
13
+ - name : Find the latest runner version
14
+ uri :
15
+ url : " https://api.github.com/repos/actions/runner/releases/latest"
16
+ url_username : " {{ github_account }}"
17
+ url_password : " {{ access_token }}"
18
+ method : GET
19
+ force_basic_auth : yes
20
+ return_content : yes
21
+ status_code : 200
22
+ body_format : json
23
+ register : api_response
24
+ run_once : yes
25
+ delegate_to : localhost
26
+ when : runner_version == "latest"
27
+ tags :
28
+ - install
29
+
30
+ - name : Set runner_version variable (if it is latest)
31
+ set_fact :
32
+ runner_version : " {{ api_response.json.tag_name | regex_replace('^v', '') }}"
33
+ when : runner_version == "latest"
34
+
13
35
- name : Download runner package version - "{{ runner_version }}"
14
36
get_url :
15
37
url : " https://github.com/actions/runner/releases/download/v{{ runner_version }}/actions-runner-linux-x64-{{ runner_version }}.tar.gz"
16
38
dest : " ./actions-runner-linux-{{ runner_version }}.tar.gz"
17
39
force : no
18
40
run_once : yes
19
41
delegate_to : localhost
20
- when : runner_version != "latest"
21
42
tags :
22
43
- install
23
44
29
50
tags :
30
51
- install
31
52
32
- - name : Register runner
53
+ - name : Register runner (if new installation)
33
54
command : " {{ runner_dir }}/./config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} \
34
55
--token {{ registration.json.token }} --unattended"
35
56
args :
Original file line number Diff line number Diff line change 8
8
tags :
9
9
- uninstall
10
10
11
+ - name : Refresh services facts
12
+ service_facts :
13
+ tags :
14
+ - uninstall
15
+
11
16
- name : Remove GitHub Actions Runner service
12
17
file :
13
18
path : " {{ item }}"
You can’t perform that action at this time.
0 commit comments