From 619f3004b2a9f8c64c0f7ab3efc68da6165876e8 Mon Sep 17 00:00:00 2001 From: Ryan Toler Date: Tue, 10 Mar 2026 06:03:34 +0000 Subject: [PATCH] restic restore --- playbooks/setup-lxc.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/playbooks/setup-lxc.yaml b/playbooks/setup-lxc.yaml index 81ddd2c..2bfb5ae 100644 --- a/playbooks/setup-lxc.yaml +++ b/playbooks/setup-lxc.yaml @@ -22,3 +22,26 @@ - name: Setup-restic.yml - setup restic ansible.builtin.import_tasks: ./setup-restic.yaml + + - name: Check if app data directory exists + stat: + path: /app/{{ hostname }} + register: app_stat + + - name: Restore Wiapp datakmd Dir + shell: | + restic --password-file /home/restic/.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target / restore latest + args: + chdir: /home/restic + creates: /app/{{ hostname }} + when: not app_stat.stat.exists or not app_stat.stat.isdir + + - name: Reload systemd daemon + systemd: + daemon_reload: yes + + - name: Start App Service + systemd: + name: {{ hostname }} + state: started + enabled: yes \ No newline at end of file