From abdd12b1d18653005f2a603ecaa5ccd113b7b3a4 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 7 Aug 2025 18:13:44 -0500 Subject: [PATCH] wip: unifi: restore data dir --- .certs | 2 +- group_vars/unifi/restic.yml | 3 +++ roles/unifi/tasks/deploy.yml | 9 +++++++++ site.yml | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.certs b/.certs index 0322911..c430ecd 160000 --- a/.certs +++ b/.certs @@ -1 +1 @@ -Subproject commit 032291106768e582219e1e9be41bb161d191bd1a +Subproject commit c430ecd3f76f07d941c1e6c62b2a447c44652411 diff --git a/group_vars/unifi/restic.yml b/group_vars/unifi/restic.yml index 6b03b02..7912f2b 100644 --- a/group_vars/unifi/restic.yml +++ b/group_vars/unifi/restic.yml @@ -1,2 +1,5 @@ restic_include: - /var/lib/unifi + +unifi_data_restore_command: >- + restic restore --path /var/lib/unifi latest diff --git a/roles/unifi/tasks/deploy.yml b/roles/unifi/tasks/deploy.yml index de8ff12..8a064f7 100644 --- a/roles/unifi/tasks/deploy.yml +++ b/roles/unifi/tasks/deploy.yml @@ -1,3 +1,12 @@ +- name: restore unifi data directory from backup + command: >- + {{ unifi_data_restore_command }} + args: + creates: /var/lib/unifi/db + when: unifi_data_restore_command|d + tags: + - restore + - name: ensure unifi.container systemd unit exists template: src: unifi.container.j2 diff --git a/site.yml b/site.yml index 4d5d080..f5f0c75 100644 --- a/site.yml +++ b/site.yml @@ -1,6 +1,7 @@ - import_playbook: host-setup.yml - import_playbook: scrape-collectd-configmap.yml +- import_playbook: restic.yml - import_playbook: fileserver.yml - import_playbook: frigate.yml - import_playbook: gitea.yml