feat: add options for backup

This commit is contained in:
Adrien Waksberg 2024-07-11 11:12:29 +02:00
parent cdf5f3090a
commit 2da9b5cfba
7 changed files with 37 additions and 25 deletions

View file

@ -45,11 +45,27 @@
enabled: true
tags: gitlab
- name: Check if skip autobackup file exists
ansible.builtin.stat:
path: /etc/gitlab/skip-auto-backup
register: st
tags: gitlab
- name: Manage skip autobackup file
ansible.builtin.file:
path: /etc/gitlab/skip-auto-backup
owner: root
group: root
mode: "0644"
state: "{{ gitlab_backup_auto | ternary('absent', 'touch')}}"
when: not st.stat.exists or gitlab_backup_auto
tags: gitlab
- name: Add backup cron
ansible.builtin.cron:
name: gitlab-backup
user: root
job: gitlab-backup create
job: "gitlab-backup create SKIP={{ gitlab_backup_skip | join(',') }}"
month: '{{ gitlab_backup_cron_month | string }}'
weekday: '{{ gitlab_backup_cron_weekday | string }}'
day: '{{ gitlab_backup_cron_day | string }}'