Module fetch fails on windows host with wildcards in filename #73128
Labels
affects_2.10
This issue/PR affects Ansible v2.10
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
traceback
This issue/PR includes a traceback.
windows
Windows community
SUMMARY
Using fetch to get files from windows hosts fails if the filename can be interpreted as a powershell wildcard. For example "new[12].txt"
ISSUE TYPE
COMPONENT NAME
connection winrm.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible host is Ubuntu 18.04. Target is Windows Server 2019 (1809)
STEPS TO REPRODUCE
Create File named "C:\www\new[12].txt" on Windows host and run task below
EXPECTED RESULTS
File is retrieved from Windows host
ACTUAL RESULTS
Ansible aborts with the error below.
FIX
Using -LiteralPath to prevent Test-Path from evaluating wildcards fixes the issue for me:
The text was updated successfully, but these errors were encountered: