Add play to backup bookstack, reorganize files

This commit is contained in:
Shaun Reed 2020-05-23 03:47:01 +00:00
parent 027e221d35
commit 1a3270d012
4 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,5 @@
---
- hosts: all
- hosts: core
become: yes
tasks:
- name: Ensure package lists are up-to-date

View File

@ -0,0 +1,18 @@
---
- hosts: bookstack
become: yes
tasks:
- name: Create backup directory if it doesn't exist
file:
path: /home/bookstackuser/backups
state: directory
- name: Backup Bookstack container files
archive:
path: /home/bookstackuser/docker-bookstack
dest: /home/bookstackuser/backups/bookstack.tgz
- name: Fetching backup files from remote host
synchronize:
src: /home/bookstackuser/backups/
dest: /home/ansibleuser/backups/
mode: pull