From cbb238522b4507674a4c5c55d0ea3fbf4069e5fa Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Fri, 5 Jan 2018 11:10:44 +0100 Subject: [PATCH] get_url tests: controller & managed node can be distinct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Templating happens on the Ansible controller, not on the task’s target host. --- test/integration/targets/get_url/tasks/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/integration/targets/get_url/tasks/main.yml b/test/integration/targets/get_url/tasks/main.yml index c4e483a8ee..995cd5790b 100644 --- a/test/integration/targets/get_url/tasks/main.yml +++ b/test/integration/targets/get_url/tasks/main.yml @@ -33,17 +33,18 @@ - name: Define test files for file schema set_fact: - geturl_srcfile: "{{ output_dir | expanduser }}/aurlfile.txt" - geturl_dstfile: "{{ output_dir | expanduser }}/aurlfile_copy.txt" + geturl_srcfile: "{{ output_dir }}/aurlfile.txt" + geturl_dstfile: "{{ output_dir }}/aurlfile_copy.txt" - name: Create source file copy: dest: "{{ geturl_srcfile }}" content: "foobar" + register: source_file_copied - name: test file fetch get_url: - url: "{{ 'file://' + geturl_srcfile }}" + url: "file://{{ source_file_copied.dest }}" dest: "{{ geturl_dstfile }}" register: result @@ -55,8 +56,8 @@ - name: test nonexisting file fetch get_url: - url: "{{ 'file://' + geturl_srcfile + 'NOFILE' }}" - dest: "{{ geturl_dstfile + 'NOFILE' }}" + url: "file://{{ source_file_copied.dest }}NOFILE" + dest: "{{ geturl_dstfile }}NOFILE" register: result ignore_errors: True