init syncthing role
This commit is contained in:
1
ansible/inventories/production/group_vars/syncthing.yaml
Normal file
1
ansible/inventories/production/group_vars/syncthing.yaml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
syncthing_version: 2.0.13
|
||||||
21
ansible/roles/syncthing/tasks/main.yaml
Normal file
21
ansible/roles/syncthing/tasks/main.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
- name: Create docker-compose project directory
|
||||||
|
file:
|
||||||
|
path: /root/syncthing
|
||||||
|
state: directory
|
||||||
|
mode: 0750
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Create docker-compose
|
||||||
|
template:
|
||||||
|
src: templates/docker-compose.yaml.j2
|
||||||
|
dest: /root/syncthing/docker-compose.yaml
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0600
|
||||||
|
|
||||||
|
- name: Run docker-compose up
|
||||||
|
command: docker compose up -d --build
|
||||||
|
args:
|
||||||
|
chdir: /root/syncthing
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
syncthing:
|
||||||
|
image: syncthing/syncthing:{{ syncthing_version }}
|
||||||
|
container_name: syncthing
|
||||||
|
hostname: {{ inventory_hostname }}
|
||||||
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
- STGUIADDRESS=
|
||||||
|
volumes:
|
||||||
|
- /var/lib/syncthing:/var/syncthing
|
||||||
|
network_mode: host
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
|
||||||
|
interval: 1m
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
@@ -5,3 +5,4 @@
|
|||||||
- common
|
- common
|
||||||
- ldap_client
|
- ldap_client
|
||||||
- docker
|
- docker
|
||||||
|
- syncthing
|
||||||
|
|||||||
Reference in New Issue
Block a user