You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect this depends on a sudo session expiring in the middle of a playbook run, but today I had my Linux bonding script (ip netns exec delegated to localhost) fail with an error 'sudo requires a password'
ansible_become_password is not defined for Linux devices, but even if it was it wouldn't be "vagrant" for become delegated to localhost
https://www.omglinux.com/change-sudo-timeout-linux/ has suggestions on how to change the sudo session timeout; Defaults timestamp_timeout=0 sets it to always require a password (so we could detect these issues)
We could either ask for the password interactively, or ask the user to set an environment variable
The text was updated successfully, but these errors were encountered:
When you figure out what's going on we might discuss whether to improve anything. Also, I don't think you can use ansible_become_password on the Ansible host.
Anyway, I expect one of two things from the users: either they know enough Linux to know what they're doing, or they follow the "use netlab on Ubuntu to install everything" recipe. That usually works ;) Trying to accommodate all sorts of Linux distros or "custom" setups is a recipe for a never-ending game of whack-a-mole.
My Linux setup is not customized, in particular sudo session timeout is set at default (15 minutes I believe)
The use of sudo when starting Containerlab typically triggers an interactive entering of the password. This starts the 15 minute timer. If I happen to start a new lab 1 minute before sudo session expiry, it will get past the Containerlab stage but may hit a wall during Ansible become processing
I suspect it's a simple setting to enable interactive asking for the sudo password in case of become delegated to localhost - but I need to test it out
If you create a Ubuntu VM from a Vagrant box, there's no timeout on sudo sessions. I got the same setup after installing Ubuntu on my server from an ISO image. Maybe they changed the defaults later?
Anyway, apart from fixing some obvious omission on our part, I don't think it's our job to figure out how Ansible playbooks should deal with sudo setups.
I suspect this depends on a
sudo
session expiring in the middle of a playbook run, but today I had my Linux bonding script (ip netns exec delegated to localhost
) fail with an error 'sudo requires a password'ansible_become_password
is not defined for Linux devices, but even if it was it wouldn't be "vagrant" for become delegated to localhosthttps://www.omglinux.com/change-sudo-timeout-linux/ has suggestions on how to change the sudo session timeout;
Defaults timestamp_timeout=0
sets it to always require a password (so we could detect these issues)We could either ask for the password interactively, or ask the user to set an environment variable
The text was updated successfully, but these errors were encountered: