My mac machine is communicating with an ec2 instance, SSH connection is established and when it's pinged ,I am getting a response as "pong", but when I run playbook facing below issue.
but when I run playbook getting below error:
PLAY [macserver] ***************************************************************
TASK [Gathering Facts] *********************************************************
fatal: [X.X.X.X]: FAILED! => {"msg": "Missing sudo password"}
PLAY RECAP *********************************************************************
X.X.X.X : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
running the playbook as ec2-user, also just to check if issue is with ec2-user added new user as "ansible" in my linux ec2 instance and started running playbook, but still same issue is persisting. Also I have added ec2-user in sudoers file.
I tried alternative method to run playbook as specified below:
"ansible-playbook paybook.yml -k -K"
command to give password and run playbook, in that scenario facing incorrect sudo password error. Whereas the password created for root, ec2-user and ansible all are same. I am not able to figure out what and where I am missing, Can anyone help me with this?