Parcourir la source

update sonerezh and owncloud with separated data

Laurent Hory il y a 9 ans
Parent
commit
4d88f9f712

+ 1 - 1
roles/gogs/tasks/main.yml

@@ -1,4 +1,4 @@
-- name: create backup directory
+- name: create gogs backup directory
   file:
     path: "{{ backup_gogs }}"
     state: directory

+ 1 - 1
roles/postfix/tasks/main.yml

@@ -1,4 +1,4 @@
-- name: create backup directory
+- name: create postfix backup directory
   file:
     path: "{{ backup_postfix }}"
     state: directory

+ 35 - 18
roles/website/tasks/main.yml

@@ -1,4 +1,4 @@
-- name: create backup directory
+- name: create website backup directory
   file:
     path: "{{ backup_website }}"
     state: directory
@@ -11,19 +11,7 @@
     dest: "{{ backup_website }}"
   with_items: "sites"
 
-### Sonerezh and sound ###
-- name: create backup directory
-  file:
-    path: "{{ backup_website }}/sound"
-    state: directory
-  delegate_to: localhost
-
-- name: backup sound website
-  synchronize:
-    mode: pull
-    src: /var/www/sound/sonerezh
-    dest: "{{ backup_website }}/sound"
-
+### Sonerezh database and sound ###
 - name: backup sonerezh database
   mysql_db:
     state: dump
@@ -41,8 +29,8 @@
 - name: backup sound data
   synchronize:
     mode: pull
-    src: /var/www/sound/Music
-    dest: "{{ backup_website }}/sound"
+    src: /var/Music
+    dest: "{{ backup_website }}"
 
 ### Owncloud ###
 - name: backup owncloud database
@@ -59,8 +47,37 @@
     src: /var/www/owncloud-sqlbkp.bak
     dest: "{{ backup_website }}"
 
-- name: backup owncloud website
+- name: backup owncloud data
   synchronize:
     mode: pull
-    src: /var/www/owncloud
+    src: /var/owncloud_data
     dest: "{{ backup_website }}"
+
+### Apache virtual hosts ###
+- name: create apache hosts backup directory
+  file:
+    path: "{{ backup_apache }}"
+    state: directory
+  delegate_to: localhost
+
+- name: backup apache virtual hosts
+  synchronize:
+    mode: pull
+    src: "/etc/apache2/sites-available/{{ item }}"
+    dest: "{{ backup_apache }}"
+  with_items: "apache_hosts"
+
+### Apache certificates ###
+- name: create certificates backup directory
+  file:
+    path: "{{ backup_certs }}"
+    state: directory
+  delegate_to: localhost
+
+- name: backup certificates
+  synchronize:
+    mode: pull
+    src: "/etc/letsencrypt/live/{{ item }}"
+    dest: "{{ backup_certs }}"
+  with_items: "certificates"
+

+ 33 - 0
roles/website/vars/main.yml

@@ -3,5 +3,38 @@ sites:
   - site
   - postfixadmin
   - wiki
+  - sonerezh
+  - owncloud
+
+apache_hosts:
+  - demo.conf
+  - demo-ssl.conf
+  - git.conf
+  - git-ssl.conf
+  - monitoring.conf
+  - monitoring-ssl.conf
+  - owncloud.hory.me.conf
+  - owncloud.hory.me-ssl.conf
+  - plante.conf
+  - plante-ssl.conf
+  - postfixadmin.conf
+  - postfixadmin-ssl.conf
+  - sound.conf
+  - sound-ssl.conf
+  - wiki.conf
+  - wiki-ssl.conf
+  - www.hory.me.conf
+  - www.hory.me-ssl.conf
+
+certificates:
+  - demo.hory.me
+  - git.hory.me
+  - monitor.hory.me
+  - postfixadmin.hory.me
+  - sound.hory.me
+  - wiki.hory.me
+  - www.hory.me
 
 backup_website: "{{ backup_path }}/website"
+backup_apache: "{{ backup_path }}/apache_hosts"
+backup_certs: "{{ backup_path }}/certificates"