add when on redeploy task ...

This commit is contained in:
2025-01-26 20:57:26 +01:00
parent 2adb0e5bd6
commit b7556696c3
2 changed files with 13 additions and 2 deletions

View File

@@ -32,4 +32,14 @@ RUNNER_INSTANCE: https://your_gitea.com/
``` ```
Hint: A token can register multible runners, in some cases it can make sense var RUNNER_TOKEN and RUNNER_LABELS define in a group. Hint: A token can register multible runners, in some cases it can make sense var RUNNER_TOKEN and RUNNER_LABELS define in a group.
For all vars look at [defaults](defaults/main.yml)! For all vars look at [defaults](defaults/main.yml)!
## features
### redeploy a runner
Somtimes it is need to redeploy a runner (with other token e.g.). in this case you can simply use this:
```yaml
RUNNER_REDEPLOY: true
```
Hint: should remove after usage!
With this option ansible delete the `.runner` file. Without this file ansible do a new registration for this runner.

View File

@@ -52,10 +52,11 @@
- name: flush handlers - name: flush handlers
meta: flush_handlers meta: flush_handlers
- name: dele .runner file for redeploy - name: delete .runner file for redeploy
ansible.builtin.file: ansible.builtin.file:
state: absent state: absent
path: "{{ RUNNER_DIR }}/.runner" path: "{{ RUNNER_DIR }}/.runner"
when: RUNNER_REDEPLOY
- name: register runner - name: register runner
notify: restart runner notify: restart runner