How to respond to prompts with pywinrm / Ansible when using win_chocolatey?

18 views
Skip to first unread message

Johnson Johnson

unread,
Apr 8, 2018, 5:57:05 PM4/8/18
to Ansible Project
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

lambd...@yahoo.com

unread,
Apr 10, 2018, 3:31:47 AM4/10/18
to Ansible Project
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]$

Jordan Borean

unread,
Apr 10, 2018, 4:13:42 AM4/10/18
to Ansible Project
Yep, win_chocolatey automatically adds the -y argument when calling choco.exe so it shouldn't be freezing on the license prompt.

Johnson Johnson

unread,
Apr 10, 2018, 9:57:20 AM4/10/18
to ansible...@googlegroups.com
Thank you Jordan!

On Tue, Apr 10, 2018 at 1:13 AM Jordan Borean <jbor...@gmail.com> wrote:
Yep, win_chocolatey automatically adds the -y argument when calling choco.exe so it shouldn't be freezing on the license prompt.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4d07de5-874c-40a3-9ba5-5c70ec95d97d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
John Knepper
Reply all
Reply to author
Forward
0 new messages