mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
Fix powershell method on non-pipelined conns (#86619)
Fixes the action plugin mkdtemp and expand_user calls to fallback to the original non-pipelined variants when a connection plugin does not support pipelining. For example a 3rd party Windows connection plugin may not support pipelining and thus cannot use the user _mkdtemp2 and _expand_user2 variants exposed by the `powershell` shell plugin as they require data to be sent over stdin.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
export ANSIBLE_CONNECTION_PLUGINS="${PWD}/connection_plugins"
|
||||
|
||||
# make sure hosts are using our custom winrm connection that disables pipelining
|
||||
ansible -i ../../inventory.winrm localhost \
|
||||
-m template \
|
||||
-a "src=test_connection.inventory.j2 dest=${OUTPUT_DIR}/test_connection.inventory" \
|
||||
"$@"
|
||||
|
||||
TEST_PLAYBOOK="${PWD}/tests.yml"
|
||||
|
||||
cd ../connection
|
||||
|
||||
INVENTORY="${OUTPUT_DIR}/test_connection.inventory" ./test.sh \
|
||||
-e target_hosts=windows \
|
||||
-e action_prefix=win_ \
|
||||
-e local_tmp=/tmp/ansible-local \
|
||||
-e remote_tmp=c:/windows/temp/ansible-remote \
|
||||
"$@"
|
||||
|
||||
cd ../connection_windows_no_pipelining
|
||||
|
||||
ansible-playbook -i "${OUTPUT_DIR}/test_connection.inventory" "${TEST_PLAYBOOK}" \
|
||||
"$@"
|
||||
Reference in New Issue
Block a user