forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.yml
73 lines (59 loc) · 1.95 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
- name: set fact out special testing dir
set_fact:
testing_dir: '{{ remote_tmp_dir }}\win_get_url .ÅÑŚÌβŁÈ [$!@^&test(;)]'
- name: create test directory with space and special chars
win_file:
path: '{{ testing_dir }}'
state: directory
- name: copy across testing files
win_copy:
src: files/
dest: '{{ testing_dir }}'
# False positive in Windows Defender is flagging the file as a virus and removing it. We need to add an exclusion so
# the tests continue to work
- name: add exclusion for the SlimFTPd binary
win_defender_exclusion:
path: '{{ remote_tmp_dir | win_dirname }}'
state: present
- name: download SlimFTPd binary
win_get_url:
url: https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_win_get_url/SlimFTPd.exe
dest: '{{ testing_dir }}\SlimFTPd.exe'
# SlimFTPd does not work with special chars because it is so old, use a symlink as a workaround
- name: set fact of temp symlink for SlimFTPd
set_fact:
slimftpd_link: C:\SlimFTPd
- name: template SlimFTPd configuration file
win_template:
src: slimftpd.conf.tmpl
dest: '{{ testing_dir }}\slimftpd.conf'
- block:
- name: create SLimFTPd symlink
win_command: cmd.exe /c mklink /d "{{ slimftpd_link }}" "{{ testing_dir }}"
- name: create SlimFTPd service
win_service:
name: SlimFTPd
path: '"{{ slimftpd_link }}\SlimFTPd.exe" -service'
state: started
dependencies:
- tcpip
- name: run URL tests
import_tasks: tests_url.yml
- name: run FTP tests
import_tasks: tests_ftp.yml
- name: run checksum tests
import_tasks: tests_checksum.yml
always:
- name: remove SlimFTPd service
win_service:
name: SlimFTPd
state: absent
- name: remove temp symlink
win_file:
path: '{{ slimftpd_link }}'
state: absent
- name: remove exclusion for the SlimFTPd binary
win_defender_exclusion:
path: '{{ remote_tmp_dir | win_dirname }}'
state: absent