ansible does require sudo password (even when key is set up)

Hey,

I am new with Ansible, trying to set up Ansible, so it won’t require password, so

  • I have bootstrap role what after success run should let Ansible run any action without password

  • When run Ansible it throws error ‘sudo: a password is required’

  • I can log in manually and run command like sudo -l or sudo echo work without password prompt

  • when add --ask-become-pass work fine (with typing manually, pass ofc)

  • I ask Ansible to use username ‘groovy’ see here ansible.cfg file

I believe there is misconception or stupid bug, but cannot figure out myself

Link to IaC repo: https://github.com/SimonHryszko/iac

Thanks in advance!
Simon

An example and the -vvv output when hitting the issue might be
helpful for other to diagnose your issue.

Sure, here is output, but what you meant via ‘example’

output of ansible-playbook site.yml --limit=precision --tags=test -vvv: https://termbin.com/3w3f

Thanks!

You are connecting as `simon`, not `groovy`, which might explain the
password requirement for sudo.

This is your config file /home/simon/Documents/IaC/ansible.cfg, make
sure the setting is correct (ansible-config dump --only-changed should
help with that).

Yeah, that was it!

I had ansible_connection=local so why it used simon user actually,

Thanks soo much!