# How to respond to prompts with pywinrm / Ansible when using win\_chocolatey?

**URL:** <https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 8, 2018, 9:57pm UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221 "2018-04-08T21:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnson\_Johnson](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Johnson\_Johnson](https://forum.ansible.com/u/Johnson_Johnson)\
**Post date:** [April 8, 2018, 9:57pm UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221/1 "2018-04-08T21:57:05Z")

</div>

How to respond to prompts with pywinrm / Ansible when using win\_chocolatey? I am installing the android-sdk kit / module with chocolatey and get prompted to accept the license (y/n), but have no way to use the expect module with windows unless I am mistaken? Thanks in advance!

John

---

<div class="post-metadata">

**Author:** ![lambda\_111](https://avatars.discourse-cdn.com/v4/letter/l/4bbf92/32.png) [@lambda\_111](https://forum.ansible.com/u/lambda_111)\
**Post date:** [April 10, 2018, 7:31am UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221/2 "2018-04-10T07:31:47Z")

</div>

Hi Johnson

License is accepted implicitly when you use chocolatey. You can install android sdk as follows. Please let me know if I am missing something

[ansible@ansibleserver playbooks]$ cat chocolatey.yml

- hosts: ansibleclient  
tasks:
- name: Install android studio  
win\_chocolatey:  
name: androidstudio  
state: present

[ansible@ansibleserver playbooks]$ ansible-playbook chocolatey.yml

PLAY [ansibleclient] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [ansibleclient]

TASK [Install android studio] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [ansibleclient]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ansibleclient : ok=2 changed=1 unreachable=0 failed=0

[ansible@ansibleserver playbooks]$

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [April 10, 2018, 8:13am UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221/3 "2018-04-10T08:13:42Z")

</div>

Yep, win\_chocolatey automatically adds the -y argument when calling choco.exe so it shouldn’t be freezing on the license prompt.

---

<div class="post-metadata">

**Author:** ![Johnson\_Johnson](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Johnson\_Johnson](https://forum.ansible.com/u/Johnson_Johnson)\
**Post date:** [April 10, 2018, 1:56pm UTC](https://forum.ansible.com/t/how-to-respond-to-prompts-with-pywinrm-ansible-when-using-win-chocolatey/27221/4 "2018-04-10T13:56:54Z")

</div>

Thank you Jordan!
