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:24:59 +02:00
parent 71df05139e
commit b3884332ba
3 changed files with 12 additions and 11 deletions

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 }}"