You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giving an invalid or non-existent file name or path to the path parameter of the archive module still executes the playbook successfully without throwing an error.
- name: Test archivehosts: ubuntu1become: truevars_files:
- vault.ymltasks:
- name: Compress file into an archivecommunity.general.archive:
path: a/random/nonexistent/fileformat: zip
The command used to run the playbook: ansible-playbook -i inventory.ini playbook.yml
Expected Results
I expected Ansible to raise an error indicating that the file I was attempting to compress into a ZIP file could not be found.
Actual Results
The playbook executes successfully without any errors, even when an invalid file path is provided. While no changes are applied, the absence of an error message can lead to confusion, especially in larger playbooks. Users might assume the action was completed successfully, overlooking the fact that the file was not found and the intended operation did not occur.
felixfontein
changed the title
The community.general.archive module executes without errors for non-existent files
The archive module executes without errors for non-existent files
Oct 11, 2024
Summary
Giving an invalid or non-existent file name or path to the
path
parameter of the archive module still executes the playbook successfully without throwing an error.Issue Type
Bug Report
Component Name
archive
Ansible Version
Community.general Version
Configuration
OS / Environment
Target OS: Ubuntu 24.04.1 LTS running in Docker
Steps to Reproduce
The command used to run the playbook:
ansible-playbook -i inventory.ini playbook.yml
Expected Results
I expected Ansible to raise an error indicating that the file I was attempting to compress into a ZIP file could not be found.
Actual Results
The playbook executes successfully without any errors, even when an invalid file path is provided. While no changes are applied, the absence of an error message can lead to confusion, especially in larger playbooks. Users might assume the action was completed successfully, overlooking the fact that the file was not found and the intended operation did not occur.
Code of Conduct
The text was updated successfully, but these errors were encountered: