Unable to install local package with win_chocolatey

257 views
Skip to first unread message

gigi...@gmail.com

unread,
Mar 29, 2019, 4:32:34 PM3/29/19
to Ansible Project

Hello,

I am able to manually install this package from the command line on the windows host like this:
choco install C:\updater\GoogleChrome-AllUsers.26.0.1410.64.nupkg

But I’m not able to do it using the win_chocolatey module from a playbook:
win_chocolatey:
    name: GoogleChrome-AllUsers
    source: C:\updater\GoogleChrome-AllUsers.26.0.1410.64.nupkg

I’ve tried a couple different versions of the above syntax, but the error is always the same:
“Error checking installation status for the package GoogleChrome-AllUsers”

In the win_chocolatey documentation is says you can use “a path to a folder” for source, but it does not seem to work. I guess I could just use the win_command module instead, but I want to get some feedback before I abandon win_chocolatey. Thanks much for any help.

Tony Chia

unread,
Mar 30, 2019, 1:12:26 PM3/30/19
to Ansible Project
I have not personally used the win_chocolatey module but here are some of the things I would try 

1) Enable verbose logging with -vvvvv when running with ansible-playbook
2) Try adding one or more of the following to the win_chocolatey module like this

win_chocolatey:
    name: GoogleChrome-AllUsers
    source: C:\updater\GoogleChrome-AllUsers.26.0.1410.64.nupkg
become: yes
become_user: Administrator
become_method: runas

I suspect when you run on the command line, you have adminstrator previlege. But the user ansible uses does not.

You can try to use the win_command module to see if you can get it to work to rule out permission issue but I suspect you will run into similar issue.


For more information on Privilege Escalation, see 

--Tony Chia

Jordan Borean

unread,
Mar 31, 2019, 3:36:17 PM3/31/19
to Ansible Project
This is a known issue with the recent release of Chocolatey, https://github.com/ansible/ansible/issues/53860#issuecomment-473431360.
Reply all
Reply to author
Forward
0 new messages