syncthing: initial hasty config
This commit is contained in:
parent
781b9c31de
commit
2cfd746c52
3 changed files with 79 additions and 0 deletions
49
roles/syncthing/tasks/main.yml
Normal file
49
roles/syncthing/tasks/main.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
- name: Install Syncthing
|
||||
apt:
|
||||
name: syncthing
|
||||
state: present
|
||||
|
||||
# - name: Ensure configuration directory is present
|
||||
# ansible.builtin.file:
|
||||
# path: '/etc/syncthing'
|
||||
# state: directory
|
||||
# mode: '0755'
|
||||
# owner: 'root'
|
||||
# group: 'root'
|
||||
#
|
||||
- name: Ensure data directory is present
|
||||
ansible.builtin.file:
|
||||
path: '/mnt/data1/syncthing'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
|
||||
- name: Ensure data subvolumes are present
|
||||
community.general.btrfs_subvolume:
|
||||
name: '/syncthing/{{ item }}'
|
||||
loop:
|
||||
- 'data'
|
||||
- 'home'
|
||||
- 'config'
|
||||
|
||||
- name: Ensure service file is present
|
||||
ansible.builtin.copy:
|
||||
src: 'syncthing.service'
|
||||
dest: '/lib/systemd/system/syncthing.service'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
register: res
|
||||
|
||||
- name: systemd-reload
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure Syncthing service is running & enabled
|
||||
service:
|
||||
name: 'syncthing'
|
||||
state: started
|
||||
enabled: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue