pigmonkey / spark

Arch Linux Provisioning with Ansible
The Unlicense
389 stars 113 forks source link

Ansible requires prompting sudo password on any AUR task #120

Open petRUShka opened 5 months ago

petRUShka commented 5 months ago

Whereas I run it with -K and prompt sudo password

❯ ansible-playbook -i localhost playbook.yml -K
BECOME password:

on any task like this:

 14 - name: Install hplip-plugin
 15   aur:
 16     name:
 17       - hplip-plugin
 18     user: "{{ user.name }}"
 19   tags:
 20     - aur
 21

I'm forced to type password. Every task!

TASK [cups : Install hplip-plugin] ********************************************************************************************
[sudo] password for user:

What do I do wrong?

petRUShka commented 5 months ago

possibly related to #74

pigmonkey commented 5 months ago

I've never run Ansible with -K before. Maybe that's causing it. Without that flag, you are just providing your password to sudo, and so should just be dealing with whatever sudo timeout period you have configured. If the timeout is 0, it would result in prompting for your password everytime sudo runs.

petRUShka commented 5 months ago

It is the same with sudo.

Like this: sudo ansible-playbook -i localhost playbook.yml.

Absolutely same

pigmonkey commented 5 months ago

I've also never run the playbook with sudo. I become root via su and then execute Ansible. I would assume that would have the same result as using sudo, but maybe there's some difference in how the shell environment gets setup or something. But I'd also check the sudo timeout period you have configured.

petRUShka commented 1 month ago

It i much better with su. But there are issues like #125 for example