only run the file.absent state if there are files to delete

This commit is contained in:
Jason Ertel
2023-12-21 09:36:47 -05:00
parent cfb5c1c9d2
commit 8189f46a03

View File

@@ -27,6 +27,8 @@ delete_curator_configuration:
- recurse: True
{% set files = salt.file.find(path='/usr/sbin', name='so-curator*') %}
{% if files|length > 0 %}
delete_curator_scripts:
file.absent:
- names: {{files|yaml}}
{% endif %}