homelab/roles/backups/tasks/main.yml

27 lines
730 B
YAML
Raw Normal View History

- name: Copy pgpass file
become: true
ansible.builtin.template:
src: pgpass.j2
dest: /root/.pgpass
mode: "0600"
owner: root
- name: Create postgresql backups volume
become: true
community.docker.docker_volume:
name: postgresql-backups
- name: Run postgresql backuper
become: true
community.docker.docker_container:
name: postgresql-backuper-1
image: git.comfycamp.space/lumin/postgresql-backuper:v0.0.3
volumes:
- postgresql-backups:/backups
- /root/.pgpass:/root/.pgpass:ro
env:
CUSTOM_ARGS: "-U postgres -h postgresql --no-password"
BACKUPS_DIR: /backups
BACKUP_INTERVAL: 24h
networks:
- name: postgresql
restart_policy: unless-stopped