What is error "Get-AnsibleWindowsWebRequestSpec"?

Viewed 2032

I am trying a test to upload a .txt file from a FTP server to a Windows client with Ansible using ansible.windows.win_get_url module like this:

Playbook:

hosts: win
gather_facts: no
tasks:
- name: Download file through FTP
  ansible.windows.win_get_url:
    url: ftp://10.30.103.3/FLAG.txt
    dest: '%TEMP%/FLAG.txt'
    url_username: test
    url_password: azerty

In the output, at the end when trying:

ansible-playbook test_ftp.yml > error.txt

I get the error:

"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 installed the modules using

ansible-galaxy collection install ansible.windows

I'm using Ansible 2.9.

1 Answers

The error was the Windows task in the playbook, changed from ansible.windows.win_get_url to win_get_url

Thank you guys for the answers.

Can you post your comment as an answer please ?

Related