Sobes.tech
Junior — Middle

What reaction will Ansible trigger when trying to delete a file that does not exist in the system?

sobes.tech AI

Answer from AI

When using the file module in Ansible with the parameter state: absent to delete a file that does not exist on the target system, Ansible will not raise an error. It will simply mark the task as "changed: false" because the file is already absent, and no changes are needed. This allows for safe deletion calls without the need for prior existence checks.