Ansible/devops/backup/tasks/girder.yml

30 lines
814 B
YAML
Raw Normal View History

2022-02-11 16:49:06 +00:00
---
# tasks file for gitlab
- name: Ensure a gitlab container is running.
docker_container:
name: "{{ gitlab_container_name }}"
state: present
image: gitlab/gitlab-ce:14.7.0-ce.0
comparisons:
'*': ignore
- name: Start gitlab backup
community.docker.docker_container_exec:
container: "{{ gitlab_container_name }}"
command: gitlab-backup create GZIP_RSYNCABLE=yes SKIP=registry
- name: Get list of backups
find:
paths: "{{ gitlab_backup_directory }}"
register: found_files
- name: Get latest backup
set_fact:
latest_file: "{{ found_files.files | sort(attribute='mtime',reverse=true) | first }}"
- name: Download latest backup from remote
ansible.posix.synchronize:
src: "{{ latest_file.path }}"
dest: "{{ gitlab_local_backup_directory }}"
mode: pull