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: roles:
- lxd_host - lxd_host
#- hosts: haproxy - hosts: haproxy
# roles: tags: containers, haproxy
# - haproxy roles:
- haproxy
# TODO: break out container init into container_default role?
- hosts: - hosts:
- dokuwiki # TODO: fix dokuwiki role
#- dokuwiki
- freshrss - freshrss
- gitweb - gitweb
tags: containers tags: containers
@ -19,11 +19,11 @@
- webserver - webserver
- hosts: freshrss - hosts: freshrss
tags: [containers, freshrss] tags: containers, freshrss
roles: roles:
- freshrss - freshrss
- hosts: dokuwiki - hosts: dokuwiki
tags: containers tags: containers, dokuwiki
roles: roles:
- dokuwiki - dokuwiki

12
roles/dokuwiki/tasks/dokuwiki.yml

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