From 3cb3a110a69410189ec4d7f027a4d364bfdbd966 Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Fri, 26 Jun 2026 14:13:12 +0200 Subject: [PATCH] woodpecker-agent: defer the docker restart so the agent self-deploy survives deploy-woodpecker-agent runs on an agent; a synchronous 'systemctl restart docker' kills the job's own container before the play finishes (pipeline 994 died at docker-install, before the daemon.json task even ran). Schedule the restart via a transient systemd timer (systemd-run --on-active=15s) so the playbook completes first, then docker restarts and picks up the IPv6 daemon.json. Co-Authored-By: Claude Opus 4.8 (1M context) --- ansible/roles/woodpecker-agent/handlers/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ansible/roles/woodpecker-agent/handlers/main.yml b/ansible/roles/woodpecker-agent/handlers/main.yml index 8d8f3494..9e56b340 100644 --- a/ansible/roles/woodpecker-agent/handlers/main.yml +++ b/ansible/roles/woodpecker-agent/handlers/main.yml @@ -1,8 +1,14 @@ --- +# Deferred + detached: restarting Docker here would kill this very CI job's +# container (the agent deploys itself). Schedule it via a transient systemd +# timer so the playbook finishes first, then Docker restarts ~15s later and +# picks up the new daemon.json. - name: Restart docker - ansible.builtin.systemd: - name: docker - state: restarted + ansible.builtin.command: + cmd: >- + systemd-run --on-active=15s --timer-property=AccuracySec=100ms + systemctl restart docker + changed_when: true - name: Restart woodpecker-agent systemd: -- 2.54.0