** Description changed:
## Steps to reproduce
1. Minimal Ansible inventory like this:
```ini
[device]
<device ip> ansible_user=user
```
2. Running without become root:
```sh
ansible device -m ansible.builtin.command -a 'id' -K -vvv
```
Works. Example output:
```txt
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),27(sudo),983(docker)
```
3. Running with become root:
```sh
ansible device -m ansible.builtin.command -a 'id' -b -K -vvv
```
... 12 seconds later ...
-
```
[ERROR]: Task failed: Timeout (12s) waiting for privilege escalation prompt:
Origin: <adhoc 'ansible.builtin.command' task>
{'action': 'ansible.builtin.command', 'args': {'_raw_params': 'id'},
'timeout': 0, 'async_val': 0, 'poll': 15}
- ubuntu-4gb-fsn1-2 | UNREACHABLE! => {
- "changed": false,
- "msg": "Task failed: Timeout (12s) waiting for privilege escalation
prompt:",
- "unreachable": true
+ device | UNREACHABLE! => {
+ "changed": false,
+ "msg": "Task failed: Timeout (12s) waiting for privilege escalation
prompt:",
+ "unreachable": true
}
```
## The fix
Adding:
```ini
[device:vars]
ansible_become_exe=/usr/bin/sudo.ws
```
to the inventory. Then running:
```sh
ansible device -m ansible.builtin.command -a 'id' -b -K -vvv
```
Works:
```txt
uid=0(root) gid=0(root) groups=0(root)
```
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: sudo-rs 0.2.13-0ubuntu1
ProcVersionSignature: Ubuntu 7.0.0-29.29-generic 7.0.12
Uname: Linux 7.0.0-29-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudID: hetzner
CloudName: hetzner
CloudPlatform: hetzner
CloudSubPlatform: unknown
Date: Sat Aug 22 15:50:40 2026
ProcEnviron:
- LANG=en_US.UTF-8
- PATH=(custom, no user)
- SHELL=/usr/bin/zsh
- TERM=xterm-256color
- XDG_RUNTIME_DIR=<set>
+ LANG=en_US.UTF-8
+ PATH=(custom, no user)
+ SHELL=/usr/bin/zsh
+ TERM=xterm-256color
+ XDG_RUNTIME_DIR=<set>
SourcePackage: rust-sudo-rs
UpgradeStatus: No upgrade log present (probably fresh install)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2164819
Title:
Prompt timeout on Ansible become root
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-sudo-rs/+bug/2164819/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs