When I auth with a non-sudo user I want to override playbook sudo.
---
name: test
hosts: foo
sudo: yes
If I do:
ansible-playbook test.yml -e "sudo=no"
It doesn't get properly override, instead I have to remove sudo: yes
from my playbook. Shouldn't sudo=no
work?
sudo
is not a variable; it's a directive. With the-e
command line parameter you have defined a variable that is calledsudo
, but this is unrelated. It would probably work if you did this in your playbook:or maybe
But if you choose to do any of the above, don't name the variable
sudo
, it will be confusing; name itmust_sudo
or something.