mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
@@ -56,7 +56,7 @@
|
||||
- 'fetched["checksum"] == "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"'
|
||||
|
||||
- name: attempt to fetch a non-existent file - do not fail on missing
|
||||
fetch: src={{ output_dir }}/doesnotexist dest={{ output_dir }}/fetched
|
||||
fetch: src={{ output_dir }}/doesnotexist dest={{ output_dir }}/fetched fail_on_missing=False
|
||||
register: fetch_missing_nofail
|
||||
|
||||
- name: check fetch missing no fail result
|
||||
@@ -78,7 +78,7 @@
|
||||
- "not fetch_missing|changed"
|
||||
|
||||
- name: attempt to fetch a directory - should not fail but return a message
|
||||
fetch: src={{ output_dir }} dest={{ output_dir }}/somedir
|
||||
fetch: src={{ output_dir }} dest={{ output_dir }}/somedir fail_on_missing=False
|
||||
register: fetch_dir
|
||||
|
||||
- name: check fetch directory result
|
||||
@@ -87,6 +87,17 @@
|
||||
- "not fetch_dir|changed"
|
||||
- "fetch_dir.msg"
|
||||
|
||||
- name: attempt to fetch a directory - should fail
|
||||
fetch: src={{ output_dir }} dest={{ output_dir }}/somedir fail_on_missing=True
|
||||
register: failed_fetch_dir
|
||||
ignore_errors: true
|
||||
|
||||
- name: check fetch directory result
|
||||
assert:
|
||||
that:
|
||||
- "failed_fetch_dir['failed']"
|
||||
- "fetch_dir.msg"
|
||||
|
||||
- name: create symlink to a file that we can fetch
|
||||
file:
|
||||
path: "{{ output_dir }}/link"
|
||||
|
||||
Reference in New Issue
Block a user