Hi,
I am trying to use apt module for installing multiple packages on my remote host. My user is not in sudoers list. However, I do have permissions to run following commands on remote host
sudo apt-get update
sudo apt-get install top
Now when I am trying to achieve same using ansible playbook, I am getting following error -
FAILED! => {“failed”: true, “msg”: “Missing sudo password”}
Following is my task definition
- name: install basic packages
apt: name={{item}} update_cache=yes
become: yes
become_method: sudo
with_items: - tree
- nload
- htop
I have tried removing become and become_method. Then I am getting standard dpkg lock error with -vvv flag -
Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)\nE: Unable to lock the administration directory (/var/lib/dpkg/), are you root?\n
What could be potential issue here ?