returning restic setup to use netbird

This commit is contained in:
Ryan Toler
2026-03-10 04:50:11 +00:00
parent 82ddaf2fa8
commit 056907019f
2 changed files with 1 additions and 52 deletions

View File

@@ -1,51 +0,0 @@
---
- name: Pull repo, copy compose and restart service if needed
hosts: localhost # run on the pull‑host itself
gather_facts: true
vars:
repo_url: "git@github.com:tolerryan/Watari-Ansible.git"
git_branch: "main" # or a tag / commit SHA
src_dir_in_repo: "playbooks"
local_clone_path: "/opt/Watari-Ansible"
apps_root: "/apps"
tasks:
- name: Pull the latest repo
ansible.builtin.git:
repo: "{{ repo_url }}"
dest: "{{ local_clone_path }}"
version: "{{ git_branch }}"
update: true # pull instead of clone on subsequent runs
register: git_result
- name: Set path to this host's compose file in the repo
set_fact:
compose_src: "{{ local_clone_path }}/{{ src_dir_in_repo }}/{{ inventory_hostname }}/docker-compose.yaml"
- name: Ensure destination directory exists
ansible.builtin.file:
path: "{{ apps_root }}/{{ inventory_hostname }}"
state: directory
mode: "0755"
- name: Copy compose file (notify if changed)
ansible.builtin.copy:
src: "{{ compose_src }}"
dest: "{{ apps_root }}/{{ inventory_hostname }}/docker-compose.yaml"
owner: root
group: root
mode: "0644"
notify: restart docker‑compose service
register: copy_result
# ------------------------------------------
# Handlers – only run if the copy task reported a change
# ------------------------------------------
handlers:
- name: restart docker‑compose service
ansible.builtin.systemd:
name: "{{ inventory_hostname }}.service"
state: restarted

View File

@@ -170,7 +170,7 @@
copy:
dest: /root/.ssh/config
content: |
Hostname misamisa.duckdns.org
Hostname misamisa.netbird.cloud
Port 25456
User restic
IdentityFile /home/restic/.ssh/resticuser.ed25519