update cv4pve autosnap role #20

Merged
mg merged 20 commits from cv4_update into master 2024-04-14 21:40:43 +02:00
3 changed files with 12 additions and 11 deletions
Showing only changes of commit b3884332ba - Show all commits

View file

@ -1,5 +1,5 @@
---
- name: create directories
- name: Ensure needed directories exist
ansible.builtin.file:
path: "/usr/local/bin/cv4pve/"
state: directory
@ -7,7 +7,7 @@
group: "{{ cv4pve_user_group }}"
mode: "0644"
- name: download archives
- name: Download specified version
ansible.builtin.unarchive:
src: "{{ cv4pve_dl_link }}"
dest: /usr/local/bin/cv4pve/
@ -19,12 +19,13 @@
list_files: true
register: download
- name: move
- name: Rename binary
ansible.builtin.command: |
mv /usr/local/bin/cv4pve/cv4pve-autosnap /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }}
when: download.changed
- name: Capture files to delete
# 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
file_type: file
@ -33,7 +34,7 @@
- "cv4pve-autosnap-{{ cv4pve_version }}"
register: found_files
- name: Delete files
- name: Ensure old versions are absent
ansible.builtin.file:
path: "{{ item.path }}"
state: absent

View file

@ -1,5 +1,5 @@
---
- name: template cv4pve.service
- name: Ensure service-unit (cv4pve) is templated
ansible.builtin.template:
src: cv4pve.service.j2
dest: /etc/systemd/system/cv4pve.service
@ -10,7 +10,7 @@
notify:
- systemctl daemon-reload
- name: template cv4pve_mail.service
- name: Ensure service-unit (mail) is templated
ansible.builtin.template:
src: cv4pve_mail.service.j2
dest: /etc/systemd/system/cv4pve_mail.service
@ -20,7 +20,7 @@
notify:
- systemctl daemon-reload
- name: template cv4pve.timer
- name: Ensure service-unit (timer) is templated
ansible.builtin.template:
src: cv4pve.timer.j2
dest: /etc/systemd/system/cv4pve.timer
@ -30,7 +30,7 @@
notify:
- systemctl daemon-reload
- name: systemctl start cv4pve.timer
- name: Ensure timer is started is templated
ansible.builtin.systemd:
name: cv4pve.timer
state: started

View file

@ -1,5 +1,5 @@
---
- name: ensure group exists
- name: Ensure group exists
become: true
ansible.builtin.group:
name: "{{ cv4pve_user_group }}"
@ -7,7 +7,7 @@
when:
- cv4pve_user_group is defined
- name: ensure user exists
- name: Ensure user exists
become: true
ansible.builtin.user:
name: "{{ cv4pve_user }}"