How to provide prompt inputs

HI,

I am trying to write an ansible playbook which will run some command on a remote server, but the problem is when this command is run, it asks for user and password which I cannot provide from the command line. I am prompted to enter these values, any idea how this can be done with Ansible?

I looked at ansible prompts but how to pass those variables to prompt?

Any help is appreciated, thanks in advance.

To run commands interactively you need to use the expect module[1] to pass it values.
It's not very well documented, but if you search the list you'll see how to use it.

[1] https://docs.ansible.com/ansible/latest/expect_module.html