Browse Source

add backup script and tags for dokuwiki

master
cinnaboot 5 years ago
parent
commit
8d896812bc
  1. 16
      all.yml
  2. 12
      roles/dokuwiki/tasks/dokuwiki.yml
  3. 30
      roles/dokuwiki/tasks/main.yml
  4. 0
      roles/haproxy/tasks/main.yml

16
all.yml

@ -4,14 +4,14 @@
roles:
- lxd_host
#- hosts: haproxy
# roles:
# - haproxy
# TODO: break out container init into container_default role?
- hosts: haproxy
tags: containers, haproxy
roles:
- haproxy
- hosts:
- dokuwiki
# TODO: fix dokuwiki role
#- dokuwiki
- freshrss
- gitweb
tags: containers
@ -19,11 +19,11 @@
- webserver
- hosts: freshrss
tags: [containers, freshrss]
tags: containers, freshrss
roles:
- freshrss
- hosts: dokuwiki
tags: containers
tags: containers, dokuwiki
roles:
- dokuwiki

12
roles/dokuwiki/tasks/dokuwiki.yml

@ -55,10 +55,14 @@
name: "{{ packages | join(' ') }}"
state: present
- name: copy lighttpd.conf
copy:
src: ../templates/lighttpd.conf.j2
dest: /etc/lighttpd/lighttpd.conf
# TODO: replace seperate template with 'line in file'
#$HTTP["url"] =~ "^/dokuwiki/(data|conf|bin|inc|vendor)/+." {
# url.access-deny = ("")
#}
# - name: copy lighttpd.conf
# copy:
# src: ../templates/lighttpd.conf.j2
# dest: /etc/lighttpd/lighttpd.conf
- name: ensure lighttpd service is started
service:

30
roles/dokuwiki/tasks/main.yml

@ -0,0 +1,30 @@
---
#- name: include dokuwiki install task
# include_tasks: dokuwiki.yml
- name: backup block
when: "'backup' in ansible_run_tags"
vars:
output: /tmp/
archive: /tmp/dokuwiki_backup.tgz
doku_path: /var/www/localhost/htdocs/dokuwiki/
block:
- name: make dokuwiki archive
community.general.archive:
dest: "{{ archive }}"
path:
- "{{ doku_path }} + conf"
- "{{ doku_path }} + data"
- "{{ doku_path }} + lib/plugins"
- name: copy archive to controller
fetch:
src: "{{ archive }}"
dest: "{{ output }}"
flat: yes
- name: remove remote archive
file:
path: "{{ archive }}"
state: absent

0
roles/haproxy/tasks/main.yml

Loading…
Cancel
Save