Browse Source

add backup tasks for gallery

master
cinnaboot 5 years ago
parent
commit
6597532e7a
  1. 3
      roles/dokuwiki/tasks/backup.yml
  2. 16
      roles/gallery/tasks/backup.yml
  3. 12
      roles/gallery/tasks/main.yml

3
roles/dokuwiki/tasks/backup.yml

@ -1,7 +1,4 @@
---
- debug:
var: doku_path
- name: make dokuwiki archive
community.general.archive:
dest: "{{ archive }}"

16
roles/gallery/tasks/backup.yml

@ -0,0 +1,16 @@
---
- name: make gallery archive
community.general.archive:
dest: "{{ archive }}"
path: "{{ album_path }}"
- name: copy archive to controller
fetch:
src: "{{ archive }}"
dest: "{{ output_dir }}"
flat: yes
- name: remove remote archive
file:
path: "{{ archive }}"
state: absent

12
roles/gallery/tasks/main.yml

@ -1,4 +1,7 @@
---
- debug:
var: ansible_run_tags
- name: install gallery
import_tasks: install.yml
vars:
@ -9,3 +12,12 @@
web_user: lighttpd
web_group: lighttpd
proxy_port: 3031
- name: backup gallery
when: "'backup' in ansible_run_tags"
import_tasks: backup.yml
tags: backup
vars:
output_dir: /tmp/
archive: "{{ output_dir }}gallery_backup.tgz"
album_path: /var/www/localhost/htdocs/gallery/instance/images

Loading…
Cancel
Save