Add play to backup bookstack, reorganize files
This commit is contained in:
17
ansible/plays/apt-up.yml
Normal file
17
ansible/plays/apt-up.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- hosts: core
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Ensure package lists are up-to-date
|
||||
apt:
|
||||
update_cache: yes
|
||||
- name: Ensure packages are up-to-date
|
||||
apt:
|
||||
upgrade: dist
|
||||
- name: Remove unused packages from the cache
|
||||
apt:
|
||||
autoclean: yes
|
||||
- name: Remove dependencies that are no longer required
|
||||
apt:
|
||||
autoremove: yes
|
||||
|
||||
18
ansible/plays/bookstack-backup.yml
Normal file
18
ansible/plays/bookstack-backup.yml
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user