Debian Codegraph @

test/integration/targets/connection_windows_ssh/tests_fetch.yml

raw
1 # This must be a play as we need to invoke it with the ANSIBLE_SCP_IF_SSH env
2 # to control the mechanism used. Unfortunately while ansible_scp_if_ssh is
3 # documented, it isn't actually used hence the separate invocation
4 ---
5 - name: further fetch tests with metachar characters in filename
6 hosts: windows
7 force_handlers: yes
8 serial: 1
9 gather_facts: no
10
11 tasks:
12 - name: setup remote tmp dir
13 import_role:
14 name: ../../setup_remote_tmp_dir
15
16 - name: create remote file with metachar in name
17 win_copy:
18 content: some content
19 dest: '{{ remote_tmp_dir }}\file ^with &whoami'
20
21 - name: test fetch against a file with cmd metacharacters
22 block:
23 - name: fetch file with metachar in name
24 fetch:
25 src: '{{ remote_tmp_dir }}\file ^with &whoami'
26 dest: ansible-test.txt
27 flat: yes
28 register: fetch_res
29
30 - name: assert fetch file with metachar in name
31 assert:
32 that:
33 - fetch_res is changed
34 - fetch_res.checksum == '94e66df8cd09d410c62d9e0dc59d3a884e458e05'
35
36 always:
37 - name: remove local copy of file
38 file:
39 path: ansible-test.txt
40 state: absent
41 delegate_to: localhost