mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes #45491 * Reduce logic complexity
This commit is contained in:
@@ -241,7 +241,7 @@
|
||||
# https://github.com/ansible/ansible/issues/29614
|
||||
- name: Change mode on an already downloaded file and specify checksum
|
||||
get_url:
|
||||
url: 'https://{{ httpbin_host }}/'
|
||||
url: 'https://{{ httpbin_host }}/get'
|
||||
dest: '{{ output_dir }}/test'
|
||||
checksum: 'sha256:7036ede810fad2b5d2e7547ec703cae8da61edbba43c23f9d7203a0239b765c4.'
|
||||
mode: '0775'
|
||||
@@ -257,6 +257,17 @@
|
||||
- result is changed
|
||||
- "stat_result.stat.mode == '0775'"
|
||||
|
||||
- name: Get a file that already exists
|
||||
get_url:
|
||||
url: 'https://{{ httpbin_host }}/get'
|
||||
dest: '{{ output_dir }}/test'
|
||||
register: result
|
||||
|
||||
- name: Assert that we didn't re-download unnecessarily
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
# https://github.com/ansible/ansible/issues/27617
|
||||
|
||||
- name: set role facts
|
||||
|
||||
Reference in New Issue
Block a user