It's totally not pointless. If you sudo ansible, you are running ansible as root locally.
It sounds like you aren't managing any remote systems in your case, so you're in a minority use case. Ansible is designed around managing remote systems, where sudo'ing ansible itself won't do you any good at all, which is why we have things like --sudo and --ask-sudo-pass Ansible will work fine with your remote sudo system and feed in the password when required when the remotes need it. However, you must always supply it, as Ansible doesn't want you saving your sudo password for those remote systems in the file. Note: this may not be the password used on the local system. On Fri, Dec 6, 2013 at 5:14 AM, anatoly techtonik <[email protected]>wrote: > Hi, > > Can Ansible check that current sudo is active? > > Right now it supports two modes: > 1. Never asking password > 2. Asking password every time > > On my system, after I enter sudo pass, systems stops asking for sudo > password for other commands for a few minutes. Is it possible to implement > the same behavior in Ansible? > > Right now I am executing `sudo ansible-playbook`, which makes fine-grained > per-task `sudo:` entries somewhat pointless. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Michael DeHaan <[email protected]> CTO, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
