diff --git a/playbooks/backup/postgres.yml b/playbooks/backup/postgres.yml new file mode 100644 index 0000000..aa39b55 --- /dev/null +++ b/playbooks/backup/postgres.yml @@ -0,0 +1,13 @@ +--- +- hosts: postgres.crypto-libertarian.com + tasks: + - name: Find PostgreSQL dumps + find: + paths: '/var/lib/postgresql/backups/12/main' + register: postgresql_dumps + + - name: Fetch PostgreSQL dumps + fetch: + src: '{{ item }}' + dest: ../../backups + with_items: "{{ postgresql_dumps.files | map(attribute='path') | list }}" diff --git a/playbooks/backup/site.yml b/playbooks/backup/site.yml index 7e6cca9..324b44c 100644 --- a/playbooks/backup/site.yml +++ b/playbooks/backup/site.yml @@ -1,2 +1,3 @@ --- - import_playbook: git.yml +- import_playbook: postgres.yml