Skip to content

Commit 30c97ee

Browse files
committed
ansible: switch watchdog timer/service definition
The watchdog service depends on the timer definition so it should be declare after, not before or it will fail to "restart the timer" Signed-off-by: Manu Bretelle <[email protected]>
1 parent e66e438 commit 30c97ee

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

ansible/roles/runner/tasks/main.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -226,39 +226,39 @@
226226
owner: root
227227
group: root
228228

229-
- name: Set actions runner watchdog service
229+
- name: Set actions runner watchdog timer
230230
become: yes
231231
ansible.builtin.copy:
232-
dest: /etc/systemd/system/actions-runner-watchdog.service
232+
dest: /etc/systemd/system/actions-runner-watchdog.timer
233233
content: |
234234
[Unit]
235-
Description=Kill unhealty actions runner containers
236-
Wants=actions-runner-watchdog.timer
235+
Description=Run actions-runner-watchdog service regularly
237236
238-
[Service]
239-
Type=oneshot
240-
ExecStart=/usr/local/sbin/actions-runner-watchdog.sh
237+
[Timer]
238+
# Run two minutes after previous run done
239+
OnBootSec=1m
240+
OnUnitInactiveSec=2m
241+
[Install]
242+
WantedBy=timers.target
241243
mode: 0644
242244
owner: root
243245
group: root
244246
notify:
245247
- reload systemd daemon
246248
- restart actions-runner-watchdog timer
247249

248-
- name: Set actions runner watchdog timer
250+
- name: Set actions runner watchdog service
249251
become: yes
250252
ansible.builtin.copy:
251-
dest: /etc/systemd/system/actions-runner-watchdog.timer
253+
dest: /etc/systemd/system/actions-runner-watchdog.service
252254
content: |
253255
[Unit]
254-
Description=Run actions-runner-watchdog service regularly
256+
Description=Kill unhealty actions runner containers
257+
Wants=actions-runner-watchdog.timer
255258
256-
[Timer]
257-
# Run two minutes after previous run done
258-
OnBootSec=1m
259-
OnUnitInactiveSec=2m
260-
[Install]
261-
WantedBy=timers.target
259+
[Service]
260+
Type=oneshot
261+
ExecStart=/usr/local/sbin/actions-runner-watchdog.sh
262262
mode: 0644
263263
owner: root
264264
group: root

0 commit comments

Comments
 (0)