feat: update Duplicati and GoLink service configurations for improved directory management and path handling
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
This commit is contained in:
parent
c70357a16d
commit
4ab7e75b6d
@ -9,8 +9,8 @@ import argparse
|
|||||||
sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin"))
|
sys.path.append(os.path.join(os.path.expanduser("~/.dotfiles"), "bin"))
|
||||||
from helpers.functions import printfe, println, logo
|
from helpers.functions import printfe, println, logo
|
||||||
|
|
||||||
# Base directory for Docker services
|
# Base directory for Docker services $HOME/services
|
||||||
SERVICES_DIR = "/mnt/storage-box/services"
|
SERVICES_DIR = os.path.join(os.path.expanduser("~"), "services")
|
||||||
|
|
||||||
def get_service_path(service_name):
|
def get_service_path(service_name):
|
||||||
"""Return the path to a service's docker-compose file"""
|
"""Return the path to a service's docker-compose file"""
|
||||||
|
@ -10,7 +10,7 @@ services:
|
|||||||
- CLI_ARGS=
|
- CLI_ARGS=
|
||||||
- SETTINGS_ENCRYPTION_KEY={{ lookup('onepassword', 'ifpbi3n3zduwhoihrc3lflmoey', field='encryption_key', vault='j7nmhqlsjmp2r6umly5t75hzb4') }}
|
- SETTINGS_ENCRYPTION_KEY={{ lookup('onepassword', 'ifpbi3n3zduwhoihrc3lflmoey', field='encryption_key', vault='j7nmhqlsjmp2r6umly5t75hzb4') }}
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/services/duplicati/data:/config
|
- {{ duplicati_data_dir }}:/config
|
||||||
ports:
|
ports:
|
||||||
- 8200:8200
|
- 8200:8200
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
- name: Deploy Duplicati service
|
- name: Deploy Duplicati service
|
||||||
block:
|
block:
|
||||||
|
- name: Set Duplicati directory path
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
duplicati_data_dir: "/mnt/storage-box/services/duplicati"
|
||||||
|
|
||||||
|
- name: Set Duplicati service directory
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
duplicati_service_dir: "{{ ansible_env.HOME }}/services/golink"
|
||||||
|
|
||||||
- name: Create Duplicati directories
|
- name: Create Duplicati directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- /mnt/storage-box/services/duplicati
|
- "{{ duplicati_data_dir }}"
|
||||||
|
- "{{ duplicati_service_dir }}"
|
||||||
|
|
||||||
- name: Deploy Duplicati docker-compose.yml
|
- name: Deploy Duplicati docker-compose.yml
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: docker-compose.yml.j2
|
src: docker-compose.yml.j2
|
||||||
dest: /mnt/storage-box/services/duplicati/docker-compose.yml
|
dest: "{{ duplicati_service_dir }}/docker-compose.yml"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
register: duplicati_compose
|
register: duplicati_compose
|
||||||
|
|
||||||
|
- name: Restart Duplicati service
|
||||||
|
ansible.builtin.command: docker compose -f "{{ duplicati_service_dir }}/docker-compose.yml" restart
|
||||||
|
when: duplicati_compose.changed
|
||||||
|
@ -4,8 +4,8 @@ services:
|
|||||||
image: ghcr.io/tailscale/golink:main
|
image: ghcr.io/tailscale/golink:main
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000
|
- PUID=1000
|
||||||
- PGID=1000
|
- PGID=100
|
||||||
- TS_AUTHKEY={{ lookup('onepassword', '4gsgavajnxfpcrjvbkqhoc4drm', vault='j7nmhqlsjmp2r6umly5t75hzb4') }}
|
- TS_AUTHKEY={{ lookup('onepassword', '4gsgavajnxfpcrjvbkqhoc4drm', field='TS_AUTHKEY', vault='j7nmhqlsjmp2r6umly5t75hzb4') }}
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/services/golink:/home/nonroot
|
- {{ golink_data_dir }}:/home/nonroot
|
||||||
restart: "unless-stopped"
|
restart: "unless-stopped"
|
||||||
|
@ -1,20 +1,29 @@
|
|||||||
- name: Deploy GoLink service
|
- name: Deploy GoLink service
|
||||||
block:
|
block:
|
||||||
|
- name: Set GoLink data directory
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
golink_data_dir: "/mnt/storage-box/services/golink"
|
||||||
|
|
||||||
|
- name: Set GoLink service directory
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
golink_service_dir: "{{ ansible_env.HOME }}/services/golink"
|
||||||
|
|
||||||
- name: Create GoLink directories
|
- name: Create GoLink directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- /mnt/storage-box/services/golink
|
- "{{ golink_data_dir }}"
|
||||||
|
- "{{ golink_service_dir }}"
|
||||||
|
|
||||||
- name: Deploy GoLink docker-compose.yml
|
- name: Deploy GoLink docker-compose.yml
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: docker-compose.yml.j2
|
src: docker-compose.yml.j2
|
||||||
dest: /mnt/storage-box/services/golink/docker-compose.yml
|
dest: "{{ golink_service_dir }}/docker-compose.yml"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
register: golink_compose
|
register: golink_compose
|
||||||
|
|
||||||
- name: Start GoLink service
|
- name: Restart GoLink service
|
||||||
ansible.builtin.command: docker-compose -f /mnt/storage-box/services/golink/docker-compose.yml up -d
|
ansible.builtin.command: docker compose -f "{{ golink_service_dir }}/docker-compose.yml" restart
|
||||||
when: golink_compose.changed
|
when: golink_compose.changed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user