1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
fedihub-ansible/playbooks/backup/wiki.yml

43 lines
1.1 KiB
YAML
Raw Normal View History

---
- hosts: wiki.crypto-libertarian.com
tasks:
- name: Remove dump of PostgreSQL database
file:
dest: /tmp/wiki_pg_dump
state: absent
- name: Dump PostgreSQL database
shell: >
PGPASSWORD={{ crypto_libertarian_wiki_db_password }}
pg_dump
-Ft
--host
{{ crypto_libertarian_wiki_db_host }}
--port
{{ crypto_libertarian_wiki_db_port }}
--username
{{ crypto_libertarian_wiki_db_user }}
--dbname
{{ crypto_libertarian_wiki_db_name }}
> /tmp/wiki_pg_dump
- name: Fetch dump of PostgreSQL database
fetch:
src: /tmp/wiki_pg_dump
2020-01-23 21:44:48 -05:00
dest: ../../backups
- name: Remove archive of "/var/www/wiki/images"
file:
dest: /tmp/wiki_images.tar.gz
state: absent
- name: Archive "/var/www/wiki/images"
archive:
path: /var/www/wiki/images
dest: /tmp/wiki_images.tar.gz
format: gz
owner: root
group: root
mode: 'u=rw,g=r,o='
- name: Fetch archive of "/var/www/wiki/images"
fetch:
src: /tmp/wiki_images.tar.gz
2020-01-23 21:44:48 -05:00
dest: ../../backups