# ansible.runner ask-pass?

**URL:** <https://forum.ansible.com/t/ansible-runner-ask-pass/19499>\
**Category:** Ansible Project\
**Created:** [October 13, 2015, 7:29pm UTC](https://forum.ansible.com/t/ansible-runner-ask-pass/19499 "2015-10-13T19:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Bogucki](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Michael\_Bogucki](https://forum.ansible.com/u/Michael_Bogucki)\
**Post date:** [October 13, 2015, 7:29pm UTC](https://forum.ansible.com/t/ansible-runner-ask-pass/19499/1 "2015-10-13T19:29:51Z")

</div>

Hi Everyone,

I’m attempting to use the ansible api to query a bunch of servers (programmatically) .

I’m running into an issue where all of my servers require a MFA-authentication+passcode.

Is there a way I can have my python/ansible script prompt me for the password?  
Obviously in a playbook or commandline call I can do an --ask-pass; however I need to leverage python for a bunch of  
‘other’ processing tasks.

I’m using this basic code as a starter: (lifted from the ansible api docs/examples)

### ansible\_hosts

`

[testservers]  
vmdsxwo83  
vmdsxwo84  
vmdsxwo85  
vmdsxwo86  
vmdsxwo87

`

### test.py

`  
#!/usr/local/bin/python

import ansible.runner

runner = ansible.runner.Runner(  
module\_name=‘command’,  
module\_args=‘uptime’,  
pattern=‘testservers’,  
forks=10  
)

datastructure = runner.run()  
print datastructure

`

Thanks.

–mike
