Clean up local_action and delegate_to in tests. (#55835)

* Remove unnecessary delegate_to in tests.

* Remove incorrect delegate_to in tests.

* Remove unnecessary use of local_action in tests.

* Remove incorrect use of local_action in tests.

* Remove unnecessary use of local_action in tests.

* Remove incorrect use of local_action in tests.

* Remove unnecessary use of local_action in tests.

* Use delegate_to instead of local_action in tests.

* Use setup_remote_tmp_dir instead of TMPDIR.
This commit is contained in:
Matt Clay
2019-04-26 17:33:59 -07:00
committed by GitHub
parent 2feda390b5
commit 149336319a
26 changed files with 117 additions and 201 deletions

View File

@@ -21,11 +21,13 @@
host_output_dir: "{{ output_dir }}/{{ inventory_hostname }}"
- name: clean out the test directory
local_action: file name={{ host_output_dir|mandatory }} state=absent
file: name={{ host_output_dir|mandatory }} state=absent
delegate_to: localhost
run_once: true
- name: create the test directory
local_action: file name={{ host_output_dir }} state=directory
file: name={{ host_output_dir }} state=directory
delegate_to: localhost
run_once: true
- name: fetch a small file
@@ -38,7 +40,8 @@
- "fetch_small.changed"
- name: check file created by fetch small
local_action: stat path={{ fetch_small.dest }}
stat: path={{ fetch_small.dest }}
delegate_to: localhost
register: fetch_small_stat
- name: verify fetched small file exists locally
@@ -67,7 +70,8 @@
- "fetch_flat.changed"
- name: check file created by fetch flat
local_action: stat path="{{ host_output_dir }}/win.ini"
stat: path="{{ host_output_dir }}/win.ini"
delegate_to: localhost
register: fetch_flat_stat
- name: verify fetched file exists locally in host_output_dir
@@ -96,7 +100,8 @@
- "fetch_large.changed"
- name: check file created by fetch large binary
local_action: stat path={{ fetch_large.dest }}
stat: path={{ fetch_large.dest }}
delegate_to: localhost
register: fetch_large_stat
- name: verify fetched large file exists locally
@@ -125,7 +130,8 @@
- "fetch_small_bs.changed"
- name: check file created by fetch small with backslashes
local_action: stat path={{ fetch_small_bs.dest }}
stat: path={{ fetch_small_bs.dest }}
delegate_to: localhost
register: fetch_small_bs_stat
- name: verify fetched small file with backslashes exists locally