diff --git a/tasks/install-repair-tools.yml b/tasks/install-repair-tools.yml index a6c2dec224633051920dcf1ce5c217e183d103d0..7ff937f459f3013ea317f73a4c633efa6e57b880 100644 --- a/tasks/install-repair-tools.yml +++ b/tasks/install-repair-tools.yml @@ -18,15 +18,22 @@ when: "ansible_facts['distribution'] == 'Debian'" - name: cleanup legacy tools - file: - path: "{{ item }}" - state: absent - loop: - - "/usr/local/bin/checkit_tiff" - - "/usr/local/bin/fixit_tiff" - - "/home/{{ vault_service_user }}/.cache/SLUB_LZA_Reparaturtool.cache" - - "/etc/cit_tiff6_baseline_SLUB.cfg" - notify: restart repairtools + block: + - name: remove legacy tools + file: + path: "{{ item }}" + state: absent + loop: + - "/usr/local/bin/checkit_tiff" + - "/usr/local/bin/fixit_tiff" + - "/etc/cit_tiff6_baseline_SLUB.cfg" + register: remove_legacy_tools + - name: remove legacy cache file + file: + path: "/home/{{ vault_service_user }}/.cache/SLUB_LZA_Reparaturtool.cache" + state: absent + notify: restart repairtools + when: remove_legacy_tools.changed # remove cache file only if legacy tools were found - name: install repairtool (package dependencies are encoded in the package) apt: