diff --git a/roles/dokuwiki/tasks/backup.yml b/roles/dokuwiki/tasks/backup.yml index aa1e02e..f0841ee 100644 --- a/roles/dokuwiki/tasks/backup.yml +++ b/roles/dokuwiki/tasks/backup.yml @@ -1,7 +1,4 @@ --- -- debug: - var: doku_path - - name: make dokuwiki archive community.general.archive: dest: "{{ archive }}" diff --git a/roles/gallery/tasks/backup.yml b/roles/gallery/tasks/backup.yml new file mode 100644 index 0000000..9dd93f5 --- /dev/null +++ b/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 diff --git a/roles/gallery/tasks/main.yml b/roles/gallery/tasks/main.yml index 5af6e97..0a395ed 100644 --- a/roles/gallery/tasks/main.yml +++ b/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