How to specify a sudo password for Ansible in non-interactive way?
We can pass variable on the command line via–extra-vars “name=value”.
Sudo password variable is ansible_sudo_pass.
So your command would look like:
ansible-playbook playbook.yml -i inventory.ini –user=username \
–extra-vars “ansible_sudo_pass=yourPassword”