fix(role): Make config deletion more robust

We previously attempted to delete a file even if none was present.
This is now fixed.
This commit is contained in:
2025-08-21 04:08:31 +02:00
parent f122b06697
commit 54d2327ec8
2 changed files with 8 additions and 8 deletions

View File

@@ -31,7 +31,7 @@
path: '{{ pkg.global_config_file }}'
- name: 'Remove per-package config'
when: 'stat_result.pkg.name not in ansible_facts.packages'
when: 'stat_result.pkg.name not in ansible_facts.packages and stat_result.stat.exists'
loop_control:
loop_var: 'stat_result'
label: 'If ''{{ stat_result.pkg.name }}'' package is absent and system-wide config file ''{{ stat_result.pkg.global_config_file }}'' is present remove config file'