#15048·algo

Two default-on blockers leave a server that reports a successful deploy and cannot authenticate

Author: rdreherCreated Sep 26, 2026Updated Sep 26, 2026

Two default-on blockers leave a server that reports a successful deploy and cannot authenticate

Both are provider-independent, both are on by default, and both fail silently — ansible-playbook exits 0 and client profiles are written, because profiles are generated locally. On macOS the only symptom is the VPN toggle flipping back with no error.

Found on commit 20e22a8, deploying to Azure (Ubuntu 22.04 minimal, 0001-com-ubuntu-minimal-jammy-daily), ansible 12.3.0, strongSwan 5.9.5. Neither bug is Azure-specific.


1. performance_parallel_services defaults to true and applies async to import_role

server.yml configures dns, wireguard, strongswan and ssh_tunneling concurrently:

yaml
- import_role: {name: strongswan}
  async: 300
  poll: 0
  register: strongswan_job

Ansible does not support async/poll on import_role. Instead of backgrounding the role as a unit, it propagates both keywords to every task the role imports, making each task fire-and-forget. Ordering inside the role is lost, so tasks run before the tasks they depend on have finished.

Registering an import_role also does not yield an async job, so strongswan_job.ansible_job_id is never defined. The wait task filters on precisely that key:

yaml
loop: "{{ _vpn_jobs | selectattr('job.ansible_job_id', 'defined') | list }}"

All four entries are filtered out, so nothing is waited on. "Check for service failures" then iterates _vpn_results.results | default([]), empty for the same reason, so nothing is verified. The play reports success having neither waited for nor checked any service.

Observed end state after a green run:

bash
$ systemctl is-active strongswan-starter
active
$ sudo ipsec listcacerts        # empty — CA never distributed
$ sudo ipsec statusall | grep -A2 Connections:
Connections:                   # empty — no conn configured

Authentication fails with no issuer certificate found for "CN=<user>".

Also worth fixing independently: the default contradicts the documentation. config.cfg lists the option under "Experimental Performance Options" as

# performance_parallel_services: false      # Configure VPN services in parallel

which reads as disabled, while server.yml evaluates performance_parallel_services | default(true). A user reading config.cfg has no way to know an experimental code path is active.

Workaround: set performance_parallel_services: false in config.cfg.

Suggested fix: default it to false, or drop the parallel block. Making it work would mean backgrounding the roles some other way — async on import_role cannot express this — and at minimum the wait/verify loops should fail loudly when they find nothing to wait on, rather than passing on an empty list.


2. ReadOnlyPaths=/proc/net/pfkey prevents strongswan-starter.service from starting

roles/strongswan/templates/100-CustomLimitations.conf.j2 contains:

ReadOnlyPaths=/proc/net/pfkey

/proc/net is a symlink to /proc/self/net, so systemd resolves it against the process it is about to spawn and tries to bind-mount /proc/<pid>/net/pfkey, which does not exist during namespace setup:

systemd[6122]: Failed to mount /run/systemd/unit-root/proc/6122/net/pfkey to
  /run/systemd/unit-root/proc/6122/net/pfkey: No such file or directory
systemd[6122]: strongswan-starter.service: Failed to set up mount namespacing:
  /run/systemd/unit-root/proc/6122/net/pfkey: No such file or directory
systemd[6122]: strongswan-starter.service: Failed at step NAMESPACE
  spawning /usr/sbin/ipsec: No such file or directory
systemd[1]: strongswan-starter.service: Main process exited,
  code=exited, status=226/NAMESPACE

charon never starts, so ipsec statusall prints nothing.

A - prefix does not help — the existence check passes on /proc/net/pfkey (present whenever af_key is loaded) and the per-pid mount still fails. Bisected:

Drop-in state Unit
As shipped failed (226/NAMESPACE)
Removed entirely active
ReadOnlyPaths=-/proc/net/pfkey failed
ReadOnlyPaths line deleted active

Suggested fix: delete the directive. charon uses the kernel-netlink plugin, not kernel-pfkey, so it never touches this path — the loaded plugin list confirms no kernel-pfkey. The rest of the drop-in works as intended.


A possible interaction, unverified

A second host deployed from the same commit runs with the drop-in in place and an active unit, so bug 2 did not reproduce everywhere. One explanation is that parallel mode never applies the drop-in at all, and that fixing bug 1 is what exposes bug 2 — which would make a fix for bug 1 alone produce a worse outcome than leaving it enabled. I have not verified this and cannot rule out a timing-dependent cause. Flagging it so whoever fixes bug 1 checks the unit state afterwards.

Suggested smoke check

Any fix here is hard to validate from playbook output. On the server:

bash
systemctl is-active strongswan-starter     # active
sudo ipsec listcacerts | head -2           # CN=<server ip>
sudo ipsec statusall | grep -A2 Connections:  # ikev2-pubkey

All three pass or the deploy did not finish, whatever it printed.

Related: #15046 (five Azure-specific blockers, same deployment).