This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
shoarma/ansible/roles/syncthing/tasks/main.yml

40 lines
862 B
YAML
Raw Normal View History

2023-05-02 11:44:19 +00:00
- name: Create working directory
file:
path: /srv/syncthing
state: directory
- name: Copy config file
template:
src: "{{ role_path }}/config.xml.j2"
dest: /srv/syncthing/config.xml
2023-05-04 11:04:57 +00:00
register: config
2023-05-02 11:44:19 +00:00
- name: Copy private key
copy:
src: "{{ role_path }}/key.pem"
dest: /srv/syncthing/key.pem
2023-05-04 11:04:57 +00:00
register: privkey
2023-05-02 11:44:19 +00:00
- name: Copy certificate
copy:
src: "{{ role_path }}/cert.pem"
dest: /srv/syncthing/cert.pem
2023-05-04 11:04:57 +00:00
register: cert
2023-05-02 11:44:19 +00:00
- name: Copy Docker stack file
template:
src: "{{ role_path }}/docker-stack.yml.j2"
dest: /srv/syncthing/docker-stack.yml
2023-05-04 11:04:57 +00:00
- name: Remove docker stack
docker_stack:
name: syncthing
state: absent
when: config.changed or privkey.changed or cert.changed
2023-05-02 11:44:19 +00:00
- name: Deploy Docker stack
docker_stack:
name: syncthing
compose:
- /srv/syncthing/docker-stack.yml