2021-11-16 15:23:42 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Create ~/.local/share/systemd/user/
|
|
|
|
file:
|
|
|
|
dest: ~/.local/share/systemd/user/
|
|
|
|
mode: '0755'
|
|
|
|
owner: jonathan
|
|
|
|
group: jonathan
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Create Systemd unit for Syncthing
|
|
|
|
copy:
|
|
|
|
src: syncthing.service
|
|
|
|
mode: "0644"
|
|
|
|
dest: ~/.local/share/systemd/user/syncthing.service
|
|
|
|
|
2022-04-25 12:48:36 +01:00
|
|
|
- name: Create Syncthing directories
|
|
|
|
file:
|
|
|
|
dest: "{{item}}"
|
|
|
|
mode: '0700'
|
|
|
|
owner: jonathan
|
|
|
|
group: jonathan
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- /home/jonathan/.config/podman/etc/syncthing
|
|
|
|
- /home/jonathan/.config/podman/syncthing
|
|
|
|
- /home/jonathan/Sync
|
|
|
|
- /home/jonathan/Code
|
|
|
|
- /home/jonathan/Udemy
|
2024-02-02 15:40:15 +00:00
|
|
|
- /home/jonathan/Photos
|
2022-04-25 12:48:36 +01:00
|
|
|
|
|
|
|
|
2021-11-16 15:23:42 +00:00
|
|
|
- name: Create and start Syncthing container
|
|
|
|
containers.podman.podman_container:
|
|
|
|
name: syncthing
|
|
|
|
image: docker.io/syncthing/syncthing
|
|
|
|
user: "0"
|
|
|
|
env:
|
|
|
|
PUID: "0"
|
|
|
|
PGID: "0"
|
|
|
|
volume:
|
2024-02-02 15:40:15 +00:00
|
|
|
- /home/jonathan/.config/podman/etc/syncthing:/var/syncthing/config
|
|
|
|
- /home/jonathan/.config/podman/syncthing/:/var/syncthing
|
|
|
|
- /home/jonathan/Sync:/home/jonathan/Sync
|
|
|
|
- /home/jonathan/Code:/home/jonathan/Code
|
|
|
|
- /home/jonathan/Udemy:/home/jonathan/Udemy
|
|
|
|
- /home/jonathan/Pictures:/home/jonathan/Pictures
|
|
|
|
- /home/jonathan/Photos:/home/jonathan/Photos
|
|
|
|
- /home/jonathan/Documents:/home/jonathan/Documents
|
2021-11-16 15:23:42 +00:00
|
|
|
network: host
|
|
|
|
restart_policy: on-failure:5
|
|
|
|
|
2022-04-25 12:48:36 +01:00
|
|
|
- name: Enable syncthing systemd unit
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: syncthing
|
|
|
|
scope: user
|
|
|
|
enabled: yes
|