mirror of
https://github.com/davestephens/ansible-nas
synced 2024-12-26 03:23:11 +00:00
Merge branch 'syncthing' of https://github.com/technicalguy/ansible-nas-1 into technicalguy-syncthing
This commit is contained in:
commit
52019dd388
5 changed files with 82 additions and 0 deletions
35
docs/applications/syncthing.md
Normal file
35
docs/applications/syncthing.md
Normal 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.
|
|
@ -55,6 +55,8 @@ By default, applications can be found on the ports listed below.
|
||||||
| Radarr | 7878 | |
|
| Radarr | 7878 | |
|
||||||
| Sickchill | 8081 | |
|
| Sickchill | 8081 | |
|
||||||
| Sonarr | 8989 | |
|
| Sonarr | 8989 | |
|
||||||
|
| Syncthing admin | 8384 | HTTP |
|
||||||
|
| Syncthing P2P | 22000 | |
|
||||||
| Tautulli | 8185 | |
|
| Tautulli | 8185 | |
|
||||||
| The Lounge | 9000 | |
|
| The Lounge | 9000 | |
|
||||||
| Time Machine | 10445 | SMB |
|
| Time Machine | 10445 | SMB |
|
||||||
|
|
5
nas.yml
5
nas.yml
|
@ -148,6 +148,11 @@
|
||||||
- sonarr
|
- sonarr
|
||||||
when: (sonarr_enabled | default(False))
|
when: (sonarr_enabled | default(False))
|
||||||
|
|
||||||
|
- role: syncthing
|
||||||
|
tags:
|
||||||
|
- syncthing
|
||||||
|
when: (syncthing_enabled | default(False))
|
||||||
|
|
||||||
- role: transmission
|
- role: transmission
|
||||||
tags:
|
tags:
|
||||||
- transmission
|
- transmission
|
||||||
|
|
17
roles/syncthing/defaults/main.yml
Normal file
17
roles/syncthing/defaults/main.yml
Normal 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
|
23
roles/syncthing/tasks/main.yml
Normal file
23
roles/syncthing/tasks/main.yml
Normal 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"
|
Loading…
Reference in a new issue