mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
win_template: fix issue where dest was specified as a directory (#39887)
This commit is contained in:
@@ -15,6 +15,12 @@ $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default
|
||||
$path = Get-AnsibleParam -obj $params -name "path" -type "path" -failifempty $true -aliases "dest","name"
|
||||
$state = Get-AnsibleParam -obj $params -name "state" -type "str" -validateset "absent","directory","file","touch"
|
||||
|
||||
# used in template/copy when dest is the path to a dir and source is a file
|
||||
$original_basename = Get-AnsibleParam -obj $params -name "original_basename" -type "str"
|
||||
if ((Test-Path -Path $path -PathType Container) -and ($null -ne $original_basename)) {
|
||||
$path = Join-Path -Path $path -ChildPath $original_basename
|
||||
}
|
||||
|
||||
$result = @{
|
||||
changed = $false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user