Hi,
i am having trouble to execute a command which needs sudo on the remote host. when i execute it directly on the host with sudo there is no ask for password but when using ansible it fails with "sudo: a password is required
i don't have root rights on the remote and i am using a jumphost. i tried all the "become" vodoo but no luck yet.
---
- hosts: loadbalancer
vars:
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q john@IP"'
tasks:
- command: yum install htop
ansible-playbook -vvvvvvvvvvv play.yml -l a-host -i hosts.yml -u john -b
"module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "parsed": false}
When i am directly on the target host as user john "sudo yum install htop" works without asking for a password so i guess NOPASSWD is set for john. I don't even have a password. I connect via ssh key.
Any ideas?