Skip to content

Commit 5c3973d

Browse files
Fix uninstall
Former-commit-id: 1aac6f7
1 parent 80c8663 commit 5c3973d

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ This role will deploy or redeploy or uninstall and register or unregister local
1212
Requirements
1313
------------
1414

15-
System must have access to the GitHub.
15+
* Supported Linux distros:
16+
* CentOS/RHEL 7,8
17+
* Fedora 16+
18+
* Ubuntu 16,17
1619

17-
CentOS/Fedora systems require EPEL repository.
20+
* System must have access to the GitHub.
1821

19-
`PERSONAL_ACCESS_TOKEN` variable needs to be exported to your environment. The token has to have admin rights for the repo.
22+
* Runner user has to be pre-created.
23+
Recommended role: `monolithprojects.user_management`
24+
25+
* CentOS/Fedora systems require EPEL repository.
26+
Recommended role: `robertdebock.epel`
27+
28+
* `PERSONAL_ACCESS_TOKEN` variable needs to be exported to your environment. The token has to have admin rights for the repo.
2029
Personal Access Token for your GitHub account can be created [here](https://github.com/settings/tokens).
2130

2231
Role Variables
@@ -25,6 +34,9 @@ Role Variables
2534
This is a copy from `defaults/main.yml`
2635

2736
```yaml
37+
# Runner user - user inder which is the local runner service running
38+
runner_user: runner
39+
2840
# Directory where the local runner will be installed
2941
runner_dir: /opt/actions-runner
3042

@@ -75,11 +87,6 @@ By using tag `uninstall`, GitHub Actions runner will be removed from the host an
7587
ansible-playbook playbook.yml --tags uninstall
7688
```
7789

78-
ToDo
79-
----
80-
81-
Full Debian/Ubuntu support
82-
8390
License
8491
-------
8592

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
# Runner user - user inder which is the local runner service running
3+
runner_user: runner
4+
25
# Directory where the local runner will be installed
36
runner_dir: /opt/actions-runner
47

tasks/uninstall_runner.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,12 @@
3939
become_user: "{{ runner_user }}"
4040
no_log: "{{ hide_sensitive_logs }}"
4141
when: ansible_hostname in registered_runners.json.runners|map(attribute='name')|list and runner_file.stat.exists
42+
tags:
43+
- uninstall
44+
45+
- name: Delete runner directory
46+
file:
47+
path: "{{ runner_dir }}"
48+
state: absent
4249
tags:
4350
- uninstall

0 commit comments

Comments
 (0)