any.software.syncthing: add role
This commit is contained in:
parent
00342d5027
commit
1a36730629
3 changed files with 62 additions and 0 deletions
31
roles/any.software.syncthing/tasks/main.yml
Normal file
31
roles/any.software.syncthing/tasks/main.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- name: Ensure Syncthing is installed
|
||||
ansible.builtin.apt:
|
||||
name: syncthing
|
||||
state: present
|
||||
|
||||
- name: Ensure data directories are present
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
loop:
|
||||
- "{{ syncthing_data_dir }}"
|
||||
- "{{ syncthing_home_dir }}"
|
||||
- "{{ syncthing_config_dir }}"
|
||||
|
||||
- name: Ensure service file is present
|
||||
ansible.builtin.template:
|
||||
src: 'syncthing.service.j2'
|
||||
dest: '/lib/systemd/system/syncthing.service'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
notify: 'restart syncthing'
|
||||
|
||||
- name: Ensure Syncthing service is enabled
|
||||
ansible.builtin.service:
|
||||
name: 'syncthing'
|
||||
enabled: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue