mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Add support for Windows hosts in the SSH connection plugin (#47732)
* Add support for Windows hosts in the SSH connection plugin * fix Python 2.6 unit test and sanity issues * fix up connection tests in CI, disable SCP for now * ensure we don't pollute the existing environment during the test * Add connection_windows_ssh to classifier * use test dir for inventory file * Required powershell as default shell and fix tests * Remove exlicit become_methods on connection * clarify console encoding comment * ignore recent SCP errors in integration tests * Add cmd shell type and added more tests * Fix some doc issues * revises windows faq * add anchors for windows links * revises windows setup page * Update changelogs/fragments/windows-ssh.yaml Co-Authored-By: jborean93 <jborean93@gmail.com>
This commit is contained in:
committed by
Matt Davis
parent
cdf475e830
commit
8ef2e6da05
@@ -0,0 +1,41 @@
|
||||
# This must be a play as we need to invoke it with the ANSIBLE_SCP_IF_SSH env
|
||||
# to control the mechanism used. Unfortunately while ansible_scp_if_ssh is
|
||||
# documented, it isn't actually used hence the separate invocation
|
||||
---
|
||||
- name: further fetch tests with metachar characters in filename
|
||||
hosts: windows-ssh
|
||||
force_handlers: yes
|
||||
serial: 1
|
||||
gather_facts: no
|
||||
|
||||
tasks:
|
||||
- name: setup remote tmp dir
|
||||
import_role:
|
||||
name: ../../setup_remote_tmp_dir
|
||||
|
||||
- name: create remote file with metachar in name
|
||||
win_copy:
|
||||
content: some content
|
||||
dest: '{{ remote_tmp_dir }}\file ^with &whoami'
|
||||
|
||||
- name: test fetch against a file with cmd metacharacters
|
||||
block:
|
||||
- name: fetch file with metachar in name
|
||||
fetch:
|
||||
src: '{{ remote_tmp_dir }}\file ^with &whoami'
|
||||
dest: ansible-test.txt
|
||||
flat: yes
|
||||
register: fetch_res
|
||||
|
||||
- name: assert fetch file with metachar in name
|
||||
assert:
|
||||
that:
|
||||
- fetch_res is changed
|
||||
- fetch_res.checksum == '94e66df8cd09d410c62d9e0dc59d3a884e458e05'
|
||||
|
||||
always:
|
||||
- name: remove local copy of file
|
||||
file:
|
||||
path: ansible-test.txt
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
Reference in New Issue
Block a user