|
|
|
@ -4,6 +4,23 @@ set -eux
|
|
|
|
|
|
|
|
|
|
cd ../connection
|
|
|
|
|
|
|
|
|
|
if [[ "$(scp -O 2>&1)" == "usage: scp "* ]]; then
|
|
|
|
|
# scp supports the -O option (and thus the -T option as well)
|
|
|
|
|
# work-around required
|
|
|
|
|
# see: https://www.openssh.com/txt/release-9.0
|
|
|
|
|
scp_args=("-e" "ansible_scp_extra_args=-TO")
|
|
|
|
|
elif [[ "$(scp -T 2>&1)" == "usage: scp "* ]]; then
|
|
|
|
|
# scp supports the -T option
|
|
|
|
|
# work-around required
|
|
|
|
|
# see: https://github.com/ansible/ansible/issues/52640
|
|
|
|
|
scp_args=("-e" "ansible_scp_extra_args=-T")
|
|
|
|
|
else
|
|
|
|
|
# scp does not support the -T or -O options
|
|
|
|
|
# no work-around required
|
|
|
|
|
# however we need to put something in the array to keep older versions of bash happy
|
|
|
|
|
scp_args=("-e" "")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# A recent patch to OpenSSH causes a validation error when running through Ansible. It seems like if the path is quoted
|
|
|
|
|
# then it will fail with 'protocol error: filename does not match request'. We currently ignore this by setting
|
|
|
|
|
# 'ansible_scp_extra_args=-T' to ignore this check but this should be removed once that bug is fixed and our test
|
|
|
|
@ -15,11 +32,11 @@ INVENTORY="${OUTPUT_DIR}/test_connection.inventory" ./test.sh \
|
|
|
|
|
-e action_prefix=win_ \
|
|
|
|
|
-e local_tmp=/tmp/ansible-local \
|
|
|
|
|
-e remote_tmp=c:/windows/temp/ansible-remote \
|
|
|
|
|
-e ansible_scp_extra_args=-T \
|
|
|
|
|
"${scp_args[@]}" \
|
|
|
|
|
"$@"
|
|
|
|
|
|
|
|
|
|
cd ../connection_windows_ssh
|
|
|
|
|
|
|
|
|
|
ansible-playbook -i "${OUTPUT_DIR}/test_connection.inventory" tests_fetch.yml \
|
|
|
|
|
-e ansible_scp_extra_args=-T \
|
|
|
|
|
"${scp_args[@]}" \
|
|
|
|
|
"$@"
|
|
|
|
|