Hey @Kajol,
Create a passphrase for the key
openssl rsa -in ssh_key.pem -out encrypted_ssh_key.pem
Give it a passphrase and provide that passphrase every time you run it, like thos:
ansible-playbook ansible_playbook -i inventory/ec2.py \
-e ansible_ssh_user=ubuntu \
-e ansible_user=ubuntu \
--private-key=encrypted_ssh_key.pem