diff --git a/ansible/apt-up.yml b/ansible/plays/apt-up.yml similarity index 96% rename from ansible/apt-up.yml rename to ansible/plays/apt-up.yml index fe0bf17..a239535 100644 --- a/ansible/apt-up.yml +++ b/ansible/plays/apt-up.yml @@ -1,5 +1,5 @@ --- -- hosts: all +- hosts: core become: yes tasks: - name: Ensure package lists are up-to-date diff --git a/ansible/plays/bookstack-backup.yml b/ansible/plays/bookstack-backup.yml new file mode 100644 index 0000000..a367cff --- /dev/null +++ b/ansible/plays/bookstack-backup.yml @@ -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 + diff --git a/ansible/core.yml b/ansible/roles/core.yml similarity index 100% rename from ansible/core.yml rename to ansible/roles/core.yml diff --git a/ansible/docker.yml b/ansible/roles/docker.yml similarity index 100% rename from ansible/docker.yml rename to ansible/roles/docker.yml