working with windows

Hi
I am a windows person so no real unix experience. I finally have ansible installed and have also successfully (I think) installed a plugin with the below
ansible-galaxy collection install ansible.windows

When trying to test this script

  • name: Install 7zip from a network share with specific credentials
    ansible.windows.win_get_url:
    path: \{SERVER}\d$\Software\7-zip\7z1900-x64.exe
    product_id: 7-Zip
    arguments: /S
    state: present

I get

fatal: [{servername}]: FAILED! => {“changed”: false, “msg”: “Unhandled exception while executing module: The term ‘Get-AnsibleWindowsWebRequestSpec’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”}

I cannot find anything that states there are powershell re-reqs and do not even know how to find where this is trying to call it (on the linux server or on my windows server)
Any help appreciated.

Thanks

That’s a powershell function that is part of the ansible.windows module.

https://github.com/ansible-collections/ansible.windows/blob/main/plugins/module_utils/WebRequest.psm1

I’ve not used it myself, but it’s sounding like that module isn’t making it’s way to your windows server.

Hope that helps you with a place to start.

Stu

Are you suggesting that I should be copying down the modules to the server that I am running the command against?
If so why doesn’t the examples show this to be the case? ie: copy down modules or at least suggest this is a pre-requisite.

This would also mean that ansible wouldn’t be an agentless solution as I would be installing extra components on my fleet of servers.

Very frustrated trying to understand how this is all meant to work

Thanks for your input.
Kez

Hi Kez,

Win_get_url module with these parameters looks a bit strange. May be it should be win_package?

чт, 3 дек. 2020 г., 10:04 Kez Halls <kezhalls@bigpond.net.au>:

Thanks. I did have win_package there and changed it based on some feedback. forgot to change before I pasted in my post.
Its still the same issue I have with win_package.