win_template: src is file dest is directory with and without ending slash #39886
Labels
affects_2.6
This issue/PR affects Ansible v2.6
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
windows
Windows community
ISSUE TYPE
COMPONENT NAME
win_template
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
Windows
SUMMARY
When using win_template to template a file to a destination that is a directory, it will either fail or create a file names
source
in the dest directory.STEPS TO REPRODUCE
See https://github.com/jborean93/github-misc/tree/master/ansible/win_template-dest-dir-39886 for 2 different playbooks that shows this behaviour
EXPECTED RESULTS
In both cases, the 1st task would copy the template to
C:\temp\template.txt
and the 2nd task would result in no change.When dest is a directory with the trailing
\
When dest is a directory without the trailing
\
ACTUAL RESULTS
When dest is a directory with the trailing
\
When dest is a directory without the trailing
\
source
in the directory specified bydest
and will always show as a changeThe text was updated successfully, but these errors were encountered: