get_url tests: controller & managed node can be distinct
Templating happens on the Ansible controller, not on the task’s target host.
This commit is contained in:
parent
be06799b20
commit
cbb238522b
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue