Handle alpine, debian and ubuntu

This commit is contained in:
nemunaire 2025-08-20 14:38:33 +02:00
parent 65d1aec53e
commit c4bc589e84
2 changed files with 12 additions and 2 deletions

View file

@ -15,4 +15,7 @@ galaxy_info:
- name: Debian - name: Debian
versions: versions:
- all - all
- name: Ubuntu
versions:
- all
galaxy_tags: [] galaxy_tags: []

View file

@ -1,8 +1,15 @@
--- ---
- name: Install restic - name: Install restic (alpine)
apk: apk:
name: name:
- restic - restic
when: ansible_distribution == 'Alpine'
- name: Install restic (Debian)
apt:
name:
- restic
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: setup backup throught cron - name: setup backup throught cron
ansible.builtin.copy: ansible.builtin.copy:
@ -20,5 +27,5 @@
{{ restic_build_command }} {{ restic_build_command }}
{% endif %} {% endif %}
restic backup {{ restic_directory }} restic backup {{ restic_directory }}
dest: "/etc/periodic/daily/backup_{{ ansible_play_name | replace(' ', '_') }}" dest: "/etc/{% if ansible_distribution == 'Alpine' %}periodic/daily{% else %}cron.daily{% endif %}/backup_{{ ansible_play_name | replace(' ', '_') }}"
mode: 0755 mode: 0755