From 1879d17dc9537c512768b3a7341f74c6cfedf592 Mon Sep 17 00:00:00 2001 From: Konstantin Renner Date: Fri, 26 Jun 2026 14:18:36 +0200 Subject: [PATCH] woodpecker-agent: enable IPv6 on pipeline networks (the actual fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The daemon.json (PR #48) only gives the *default bridge* IPv6 — but Woodpecker runs each step on a per-pipeline network, which it creates WITHOUT IPv6 unless told to. So step containers still had no v6 and the deploy to v6-only proxy-1 kept failing 'Network unreachable'. Set WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6=true on the agent so it creates v6-enabled pipeline networks (pairs with the daemon.json ipv6/ip6tables NAT). Also defer the woodpecker-agent restart (systemd-run timer) so the agent self-deploy doesn't interrupt its own running pipeline. Ref: https://woodpecker-ci.org/docs/administration/configuration/backends/docker Co-Authored-By: Claude Opus 4.8 (1M context) --- ansible/roles/woodpecker-agent/handlers/main.yml | 11 +++++++---- ansible/roles/woodpecker-agent/templates/agent.env.j2 | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ansible/roles/woodpecker-agent/handlers/main.yml b/ansible/roles/woodpecker-agent/handlers/main.yml index 9e56b340..7117ad73 100644 --- a/ansible/roles/woodpecker-agent/handlers/main.yml +++ b/ansible/roles/woodpecker-agent/handlers/main.yml @@ -10,8 +10,11 @@ systemctl restart docker changed_when: true +# Also deferred: the agent restarting itself would interrupt the very +# pipeline running this deploy. Reload the unit now, restart on a timer. - name: Restart woodpecker-agent - systemd: - name: woodpecker-agent - state: restarted - daemon_reload: yes + ansible.builtin.command: + cmd: >- + systemd-run --on-active=20s --timer-property=AccuracySec=100ms + sh -c "systemctl daemon-reload && systemctl restart woodpecker-agent" + changed_when: true diff --git a/ansible/roles/woodpecker-agent/templates/agent.env.j2 b/ansible/roles/woodpecker-agent/templates/agent.env.j2 index 0a34e965..06cbc8b3 100644 --- a/ansible/roles/woodpecker-agent/templates/agent.env.j2 +++ b/ansible/roles/woodpecker-agent/templates/agent.env.j2 @@ -3,3 +3,6 @@ WOODPECKER_AGENT_SECRET={{ woodpecker_grpc_secret }} WOODPECKER_MAX_WORKFLOWS={{ woodpecker_max_workflows }} WOODPECKER_BACKEND=docker WOODPECKER_HOSTNAME={{ inventory_hostname }} +# Create pipeline-step networks with IPv6 so steps can reach v6-only hosts +# (pairs with the Docker daemon.json ipv6/ip6tables config). +WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6=true -- 2.54.0