# Issue with ansible-runner

**URL:** <https://forum.ansible.com/t/issue-with-ansible-runner/3846>\
**Category:** Get Help\
**Created:** [February 13, 2024, 11:19am UTC](https://forum.ansible.com/t/issue-with-ansible-runner/3846 "2024-02-13T11:19:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beerhardt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/beerhardt/32/2293_2.png) [@beerhardt](https://forum.ansible.com/u/beerhardt)\
**Post date:** [February 13, 2024, 11:19am UTC](https://forum.ansible.com/t/issue-with-ansible-runner/3846/1 "2024-02-13T11:19:39Z")

</div>

Hi all,

I’m having an issue with runner:

r = ansible\_runner.run(inventory=“rubuntu”, playbook=“/home/ro/rubuntutest.yml”, passwords={“Password:\s\*?$”: “pipo”})

it seems like I’m using passwords wrong since it doesn’t login in the machine to do stuff, if i launch the playbook manually and insert the password manually everything works.

How should i fix the password field?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![shrews](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shrews/32/10142_2.png) [@shrews](https://forum.ansible.com/u/shrews)\
**Post date:** [February 14, 2024, 4:07pm UTC](https://forum.ansible.com/t/issue-with-ansible-runner/3846/2 "2024-02-14T16:07:00Z")

</div>

What do you mean by “doesn’t login”? Are you getting an error message back from ansible-playbook? Is runner hanging during the run? Is this supposed to be the SSH password or the BECOME password?

You generally need to supply a command line option to ansible-playbook to force it to prompt for the password (`-k` or `-K`, depending on your needs). There is a `run()` option for this named `cmdline`. And your password regex is probably not correct. Example:

```auto
r = ansible_runner.run(
    inventory="rubuntu",
    playbook="/home/ro/rubuntutest.yml",
    cmdline="-k",
    passwords={"SSH Password:\\s*?$": "my_password_here"}
)

```

The [docs have some more examples](https://ansible.readthedocs.io/projects/runner/en/latest/intro/#env-passwords) and info, in case you haven’t seen it.
