From f5611498042e7073eb422f3c3304b5934a811371 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Sun, 14 Apr 2024 21:28:18 +0200 Subject: [PATCH] f --- roles/mgrote_cv4pve_autosnap/tasks/install.yml | 10 +++++----- .../mgrote_cv4pve_autosnap/templates/cv4pve.service.j2 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/mgrote_cv4pve_autosnap/tasks/install.yml b/roles/mgrote_cv4pve_autosnap/tasks/install.yml index 08943f31..9ebea2ab 100644 --- a/roles/mgrote_cv4pve_autosnap/tasks/install.yml +++ b/roles/mgrote_cv4pve_autosnap/tasks/install.yml @@ -1,7 +1,7 @@ --- - name: Ensure needed directories exist ansible.builtin.file: - path: "/usr/local/bin/cv4pve/" + path: "{{ cv4pve_base_path }}" state: directory owner: "{{ cv4pve_user }}" group: "{{ cv4pve_user_group }}" @@ -10,24 +10,24 @@ - name: Download specified version ansible.builtin.unarchive: src: "{{ cv4pve_dl_link }}" - dest: /usr/local/bin/cv4pve/ + dest: "{{ cv4pve_base_path }}" mode: '0755' owner: "{{ cv4pve_user }}" group: "{{ cv4pve_user_group }}" remote_src: yes - creates: /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }} + creates: "{{ cv4pve_base_path }}/cv4pve-autosnap-{{ cv4pve_version }}" list_files: true register: download - name: Rename binary ansible.builtin.command: | - mv /usr/local/bin/cv4pve/cv4pve-autosnap /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }} + mv "{{ cv4pve_base_path }}/cv4pve-autosnap" "{{ cv4pve_base_path }}/cv4pve-autosnap-{{ cv4pve_version }}" when: download.changed # https://stackoverflow.com/questions/20252057/using-ansible-how-would-i-delete-all-items-except-for-a-specified-set-in-a-dire - name: Find old versions ansible.builtin.find: - paths: /usr/local/bin/cv4pve + paths: "{{ cv4pve_base_path }}" file_type: file use_regex: false excludes: diff --git a/roles/mgrote_cv4pve_autosnap/templates/cv4pve.service.j2 b/roles/mgrote_cv4pve_autosnap/templates/cv4pve.service.j2 index 1a86fbe7..11490cf1 100644 --- a/roles/mgrote_cv4pve_autosnap/templates/cv4pve.service.j2 +++ b/roles/mgrote_cv4pve_autosnap/templates/cv4pve.service.j2 @@ -6,4 +6,4 @@ OnFailure=cv4pve_mail.service [Service] Type=simple -ExecStart=/usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }} --host=127.0.0.1 --api-token {{ cv4pve_api_user }}={{ cv4pve_api_token }} --vmid="{{ cv4pve_vmid }}" snap --label='daily' --keep="{{ cv4pve_keep_snapshots }}" --state +ExecStart={{ cv4pve_base_path }}/cv4pve-autosnap-{{ cv4pve_version }} --host=127.0.0.1 --api-token {{ cv4pve_api_user }}={{ cv4pve_api_token }} --vmid="{{ cv4pve_vmid }}" snap --label='daily' --keep="{{ cv4pve_keep_snapshots }}" --state