Till Klocke 8 роки тому
батько
коміт
c48a936a70

BIN
roles/common-restic/files/restic_linux_amd64


+ 21 - 0
roles/common-restic/tasks/main.yml

@@ -0,0 +1,21 @@
+- name: Ensure restic binary is in place
+  copy:
+    src: restic_linux_amd64
+    dest: /usr/local/bin
+
+- name: Ensure restic password file exists
+  copy:
+    dest: /root/.rest.password
+    content: "{{ restic_repo_password }}"
+    mode: 0600
+
+- name: Init restic repository
+  shell: /usr/local/bin/restic -p /root/.rest.password -t {{ restic_repo }} init || true
+
+- name: Ensure restic cron jobs exist
+  cron:
+    name: Restic backups for {{ item.dir }}
+    job: /usr/local/bin/restic -p /root/.rest.password -t {{ restic_repo }} backup {{ item.dir }}
+    hour: 2
+    minute: 35
+  with_items: "{{ restic_stateful_dirs }}"

+ 2 - 2
roles/service-gogs/tasks/nginx.yml

@@ -1,7 +1,7 @@
 - name: Ensure nginx configuration is up to date
   template:
-    src: {{ item.src }}
-    dest: /etc/nginx/sites-available/{{ item.dest }}
+    src: "{{ item.src }}"
+    dest: "/etc/nginx/sites-available/{{ item.dest }}"
   with_items:
     - src: gogs_nginx.conf.j2
       dest: gogs.conf

+ 1 - 1
roles/service-nginx/tasks/acmetool.yml

@@ -11,7 +11,7 @@
   apt: name=acmetool install_recommends=no
 
 - name: Ensure acmetool response file is up to date
-  rehister: responsefile
+  register: responsefile
   template: 
     src: acme_config.j2
     dest: /var/lib/acme/responses.yml