Merge branch 'syncthing' of https://github.com/technicalguy/ansible-nas-1 into technicalguy-syncthing

This commit is contained in:
Dave Stephens 2021-01-22 21:23:51 +00:00
commit 52019dd388
5 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,35 @@
# Syncthing: Open Source Continuous File Synchronisation
Homepage: [https://syncthing.net/](https://syncthing.net/)
Github: [https://github.com/syncthing/syncthing](https://github.com/syncthing/syncthing)
Docker: [https://hub.docker.com/r/syncthing/syncthing](https://hub.docker.com/r/syncthing/syncthing)
Syncthing is a continuous file synchronization program. It synchronizes files
between two or more computers. It strives to fulfill the goals below in summary.
Syncthing should be:
1. Safe From Data Loss
2. Secure Against Attackers
3. Easy to Use
4. Automatic
5. Universally Available
6. For Individuals
7. For eveything else see the goals document
## Usage
Set `syncthing_enabled: true` in your `group_vars/all.yml` file.
## Specific Configuration
Open the web interface at :8384 to configure.
The tasks/syncthing.yml sets
```yaml
env:
STGUIADDRESS: ""
```
which disables admin GUI access from anywhere except localhost. You can either
remove this (at which point it is visible to your whole network), or use
Traefik. In either case you should consider setting an admin password in the
syncthing GUI.

View file

@ -55,6 +55,8 @@ By default, applications can be found on the ports listed below.
| Radarr | 7878 | |
| Sickchill | 8081 | |
| Sonarr | 8989 | |
| Syncthing admin | 8384 | HTTP |
| Syncthing P2P | 22000 | |
| Tautulli | 8185 | |
| The Lounge | 9000 | |
| Time Machine | 10445 | SMB |

View file

@ -148,6 +148,11 @@
- sonarr
when: (sonarr_enabled | default(False))
- role: syncthing
tags:
- syncthing
when: (syncthing_enabled | default(False))
- role: transmission
tags:
- transmission

View file

@ -0,0 +1,17 @@
---
syncthing_enabled: false
syncthing_available_externally: "false"
# directories
syncthing_data_directory: "{{ samba_shares_root }}/syncthing"
# these are the directories that you want to mount from the local ansible-nas filesystem into
# the syncthing container.
# format is:
# - "/ansible/nas/filesystem/directory_name:/var/syncthing/directory_name"
syncthing_volumes:
- "{{ syncthing_data_directory }}:/var/syncthing/"
# network
syncthing_port: 8384
syncthing_hostname: syncthing

View file

@ -0,0 +1,23 @@
---
- name: Create Syncthing Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ syncthing_data_directory }}"
- name: Syncthing Docker Container
docker_container:
name: syncthing
image: syncthing/syncthing:latest
pull: true
network_mode: host
volumes: "{{ syncthing_volumes }}"
restart_policy: unless-stopped
labels:
traefik.enable: "{{ syncthing_available_externally }}"
traefik.http.routers.syncthing.rule: "Host(`{{ syncthing_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.syncthing.tls.certresolver: "letsencrypt"
traefik.http.routers.syncthing.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.syncthing.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.syncthing.loadbalancer.server.port: "8384"