ff
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 20:54:34 +02:00
parent d255126da5
commit 8ab23df606
7 changed files with 13 additions and 20 deletions

View file

@ -28,6 +28,9 @@ users:
allow_sudo: true
allow_passwordless_sudo: true
### cv4pve
cv4pve_version: "v1.14.8"
### mgrote_apt_manage_packages
apt_packages_extra:
- ifupdown2

View file

@ -1,11 +0,0 @@
## mgrote.cv4pve
### Beschreibung
Installiert [cv4pve-autosnap](https://github.com/Corsinvest/cv4pve-autosnap).
Legt einen systemd-timer.
### getestet auf
- [x] ProxMox 7*
### Variablen + Defaults
- see [defaults](./defaults/main.yml)

View file

@ -12,3 +12,6 @@ cv4pve_keep_snapshots: 3
# under which user the script is run
cv4pve_user_group: cv4pve
cv4pve_user: cv4pve
# url
cv4pve_dl_link: https://github.com/Corsinvest/cv4pve-autosnap/releases/download/{{ cv4pve_version }}/cv4pve-autosnap-linux-x64.zip
cv4pve_version: "v1.14.8"

View file

@ -2,7 +2,6 @@
- name: include user tasks
ansible.builtin.include_tasks: user.yml
- name: create directories
become: true
ansible.builtin.file:
@ -17,18 +16,19 @@
- name: download archives
become: true
ansible.builtin.get_url:
url: "{{ cv4pve_dl_link }}"
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
ansible.builtin.unarchive:
src: "{{ cv4pve_dl_link }}"
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64-{{ cv4pve_version }}.zip
mode: '0775'
owner: "{{ cv4pve_user }}"
group: "{{ cv4pve_user_group }}"
remote_src: yes
- name: extract archives
become: true
ansible.builtin.unarchive:
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
dest: /usr/local/bin/cv4pve
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64-{{ cv4pve_version }}.zip
dest: /usr/local/bin/cv4pve-{{ cv4pve_version }}
remote_src: true
mode: a+x
owner: "{{ cv4pve_user }}"

View file

@ -6,4 +6,4 @@ OnFailure=cv4pve_mail.service
[Service]
Type=simple
ExecStart=/usr/local/bin/cv4pve/cv4pve-autosnap --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=/usr/local/bin/cv4pve-{{ cv4pve_version }}/cv4pve-autosnap --host=127.0.0.1 --api-token {{ cv4pve_api_user }}={{ cv4pve_api_token }} --vmid="{{ cv4pve_vmid }}" snap --label='daily' --keep="{{ cv4pve_keep_snapshots }}" --state

View file

@ -6,6 +6,5 @@ Description=Timer: Trigger VM-Snapshots in PVE with cv4pve.
OnCalendar=*-*-* {{ cv4pve_cron_hour }}:{{ cv4pve_cron_minute }}:00
RandomizedDelaySec=10 min
[Install]
WantedBy=timers.target multi-user.target

View file

@ -1,5 +1,4 @@
{{ file_header | default () }}
[Unit]
Description=Send a Mail in case of an error in cv4pve.service.