They say birds recognise their chicks by the sound of their call, and that it only takes the call changing a little for the mother to hesitate, unsure whether that thing chirping in the nest is hers. Well, something like that is happening to Ansible with Ubuntu 26.04.
Jeff Geerling ran into it while migrating his servers from Ubuntu 22 and 24: playbooks that use become with a sudo password stop working as soon as the server is a 26.04, and they fail on the very first task, fact gathering:
$ ansible-playbook main.yml -K
BECOME password:
PLAY [Security] ****************************************************
TASK [Gathering Facts] *********************************************
fatal: [my-server.local]: FAILED! =>
msg: 'Timeout (12s) waiting for privilege escalation prompt: '
If your sudo doesn’t ask for a password (NOPASSWD), you won’t notice anything. If it does, there goes your playbook.
What happened
Ubuntu 26.04 ships sudo-rs, the Rust rewrite of sudo, by default instead of the good old sudo. And sudo-rs prints an extra string before asking for the password, something classic sudo doesn’t do. Ansible, to know when to send the password, waits to see the prompt it knows… and since what arrives isn’t exactly that, it waits 12 seconds and gives up.
It’s the mother bird from before: the chick is there, asking for the same thing as always, but with a slightly different chirp, and she doesn’t recognise it.
How to fix it
There are three ways, from most to least recommended:
1. Upgrade Ansible. The fix is in Ansible Core 2.22.0, and it’s being backported to 2.16, 2.18, 2.19, 2.20 and possibly 2.21 (tracked in this issue). Geerling confirms that with this -K works again:
pip install -U ansible
2. Use classic sudo just for Ansible. Ubuntu 26.04 still includes traditional sudo as sudo.ws, so you can tell Ansible to use that one on the affected hosts:
[servers]
my-server.local ansible_become_exe=sudo.ws
3. Switch back to classic sudo system-wide, choosing it with Debian/Ubuntu alternatives:
sudo update-alternatives --config sudo
I’d keep this last one for when there’s no other option, because it undoes an operating system decision to fix one tool’s problem. If you use pyinfra, it was affected too, and the fix is in version 3.11.
What I take away
Recently I wrote about the Rust rewrites of curl, and this is the other side of the same coin. Rewriting a basic tool in a safer language makes a lot of sense, but “compatible” doesn’t just mean accepting the same options: it also means the output, the messages and even the strings nobody thought mattered stay the same, because there’s always someone (here, Ansible) who has been reading them and depending on them for years.
Geerling wonders whether it’s worth Ubuntu swapping such basic pieces on its own, and hints that, if it carries on like this, he may go back to Debian. I wouldn’t go that far over this, since it has a simple fix, but I would add it to the list of things to test before upgrading servers to 26.04: run your playbooks against a test machine before it catches you in production.




