f
Some checks failed
ci/woodpecker/push/gitleaks Pipeline was successful
ci/woodpecker/push/ansible-lint Pipeline failed

This commit is contained in:
Michael Grote 2024-04-14 21:28:18 +02:00
parent 670db818b8
commit f561149804
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
--- ---
- name: Ensure needed directories exist - name: Ensure needed directories exist
ansible.builtin.file: ansible.builtin.file:
path: "/usr/local/bin/cv4pve/" path: "{{ cv4pve_base_path }}"
state: directory state: directory
owner: "{{ cv4pve_user }}" owner: "{{ cv4pve_user }}"
group: "{{ cv4pve_user_group }}" group: "{{ cv4pve_user_group }}"
@ -10,24 +10,24 @@
- name: Download specified version - name: Download specified version
ansible.builtin.unarchive: ansible.builtin.unarchive:
src: "{{ cv4pve_dl_link }}" src: "{{ cv4pve_dl_link }}"
dest: /usr/local/bin/cv4pve/ dest: "{{ cv4pve_base_path }}"
mode: '0755' mode: '0755'
owner: "{{ cv4pve_user }}" owner: "{{ cv4pve_user }}"
group: "{{ cv4pve_user_group }}" group: "{{ cv4pve_user_group }}"
remote_src: yes remote_src: yes
creates: /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }} creates: "{{ cv4pve_base_path }}/cv4pve-autosnap-{{ cv4pve_version }}"
list_files: true list_files: true
register: download register: download
- name: Rename binary - name: Rename binary
ansible.builtin.command: | 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 when: download.changed
# https://stackoverflow.com/questions/20252057/using-ansible-how-would-i-delete-all-items-except-for-a-specified-set-in-a-dire # 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 - name: Find old versions
ansible.builtin.find: ansible.builtin.find:
paths: /usr/local/bin/cv4pve paths: "{{ cv4pve_base_path }}"
file_type: file file_type: file
use_regex: false use_regex: false
excludes: excludes:

View file

@ -6,4 +6,4 @@ OnFailure=cv4pve_mail.service
[Service] [Service]
Type=simple 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