Monday 14 March 2022

ansible-playbook fatal: [localhost]: FAILED! => {"msg": "Missing sudo password"}


 Issue

ansible-playbook demo_playbook.yml -i inventory.ini

PLAY [This demo playbook] *******************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************

fatal: [localhost]: FAILED! => {"msg": "Missing sudo password"}

PLAY RECAP **********************************************************************************************************************************************************************************

localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


Troubleshoot 

#execute from command line
ansible-playbook demo_playbook.yml -i demo.ini --user=user_name --extra-vars "ansible_sudo_pass=password"

OR

#add the following line in inventory.ini
[all:vars]
ansible_sudo_pass="password"

No comments:

Post a Comment