From fe036308592d86a1a516ef064351caa8375e198e Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sun, 14 Apr 2024 21:17:13 +0200 Subject: [PATCH] ff --- roles/mgrote_cv4pve_autosnap/tasks/main.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/roles/mgrote_cv4pve_autosnap/tasks/main.yml b/roles/mgrote_cv4pve_autosnap/tasks/main.yml index 1247add7..386e9553 100644 --- a/roles/mgrote_cv4pve_autosnap/tasks/main.yml +++ b/roles/mgrote_cv4pve_autosnap/tasks/main.yml @@ -63,10 +63,23 @@ state: started enabled: true +- name: Capture files to delete + find: + paths: /usr/local/bin/cv4pve + file_type: file + excludes: + - "/usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }}" + register: found_files -- name: remove old cv4pve versions - ansible.builtin.command: | - rm -rf /tmp/cv4pve/cv4pve-autosnap-linux-x64-{{ cv4pve_version }} - path: "{{ item['path'] }}" +- name: Delete files + file: + path: "{{ item.path }}" state: absent + with_items: "{{ found_files['files'] }}" ... + + +# permissions +# etxte +#linter +# varioablen