mirror of
https://github.com/RealOrangeOne/infrastructure.git
synced 2026-07-17 16:35:58 +00:00
Deploy a syncthing on pve-docker
This commit is contained in:
parent
b56f476173
commit
f3f57faf41
4 changed files with 33 additions and 0 deletions
|
|
@ -78,6 +78,7 @@
|
|||
- freshrss
|
||||
- atuin
|
||||
- karakeep
|
||||
- syncthing
|
||||
|
||||
- hosts: ingress
|
||||
roles:
|
||||
|
|
|
|||
12
ansible/roles/syncthing/files/docker-compose.yml
Normal file
12
ansible/roles/syncthing/files/docker-compose.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
services:
|
||||
syncthing:
|
||||
image: syncthing/syncthing:latest
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
hostname: "{{ ansible_hostname }}"
|
||||
environment:
|
||||
- TZ={{ timezone }}
|
||||
- PUID={{ docker_user.id }}
|
||||
- PGID={{ docker_user.id }}
|
||||
volumes:
|
||||
- /mnt/tank/files:/var/syncthing
|
||||
4
ansible/roles/syncthing/handlers/main.yml
Normal file
4
ansible/roles/syncthing/handlers/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
- name: restart syncthing
|
||||
shell:
|
||||
chdir: /opt/syncthing
|
||||
cmd: "{{ docker_update_command }}"
|
||||
16
ansible/roles/syncthing/tasks/main.yml
Normal file
16
ansible/roles/syncthing/tasks/main.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
- name: Create install directory
|
||||
file:
|
||||
path: /opt/syncthing
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
|
||||
|
||||
- name: Install compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/syncthing/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker compose -f %s config
|
||||
notify: restart syncthing
|
||||
Loading…
Add table
Add a link
Reference in a new issue