mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
parent
90a229c793
commit
a0dfa8616a
5 changed files with 48 additions and 18 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue