2019-07-22 00:42:24 +02:00
|
|
|
# Due to the special environment setup required for proxies, you can manually test out the proxy options with
|
|
|
|
# https://github.com/jborean93/ansible-powershell-url-proxy.
|
2018-05-04 00:39:37 +02:00
|
|
|
---
|
2019-03-19 03:01:35 +01:00
|
|
|
- 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
|
|
|
|
|
2018-05-04 00:39:37 +02:00
|
|
|
- name: copy across testing files
|
|
|
|
win_copy:
|
|
|
|
src: files/
|
2019-03-19 03:01:35 +01:00
|
|
|
dest: '{{ testing_dir }}'
|
2018-05-04 00:39:37 +02:00
|
|
|
|
2019-05-23 08:16:47 +02:00
|
|
|
# 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
|
|
|
|
|
2018-05-04 00:39:37 +02:00
|
|
|
- name: download SlimFTPd binary
|
|
|
|
win_get_url:
|
2019-05-15 02:50:56 +02:00
|
|
|
url: https://ansible-ci-files.s3.amazonaws.com/test/integration/roles/test_win_get_url/SlimFTPd.exe
|
2019-03-19 03:01:35 +01:00
|
|
|
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
|
2018-05-04 00:39:37 +02:00
|
|
|
|
|
|
|
- name: template SlimFTPd configuration file
|
|
|
|
win_template:
|
|
|
|
src: slimftpd.conf.tmpl
|
2019-03-19 03:01:35 +01:00
|
|
|
dest: '{{ testing_dir }}\slimftpd.conf'
|
2018-05-04 00:39:37 +02:00
|
|
|
|
|
|
|
- block:
|
2019-03-19 03:01:35 +01:00
|
|
|
- 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
|
|
|
|
|
2018-05-04 00:39:37 +02:00
|
|
|
- name: run URL tests
|
2019-03-13 23:04:49 +01:00
|
|
|
import_tasks: tests_url.yml
|
2018-05-04 00:39:37 +02:00
|
|
|
|
|
|
|
- name: run FTP tests
|
2019-03-13 23:04:49 +01:00
|
|
|
import_tasks: tests_ftp.yml
|
2018-05-04 00:39:37 +02:00
|
|
|
|
2019-03-05 11:37:00 +01:00
|
|
|
- name: run checksum tests
|
2019-03-13 23:04:49 +01:00
|
|
|
import_tasks: tests_checksum.yml
|
2019-03-05 11:37:00 +01:00
|
|
|
|
2018-05-04 00:39:37 +02:00
|
|
|
always:
|
|
|
|
- name: remove SlimFTPd service
|
|
|
|
win_service:
|
|
|
|
name: SlimFTPd
|
|
|
|
state: absent
|
2019-03-19 03:01:35 +01:00
|
|
|
|
|
|
|
- name: remove temp symlink
|
|
|
|
win_file:
|
|
|
|
path: '{{ slimftpd_link }}'
|
|
|
|
state: absent
|
2019-05-23 08:16:47 +02:00
|
|
|
|
|
|
|
- name: remove exclusion for the SlimFTPd binary
|
|
|
|
win_defender_exclusion:
|
|
|
|
path: '{{ remote_tmp_dir | win_dirname }}'
|
|
|
|
state: absent
|