parameterize directories

This commit is contained in:
Pim Kunis 2023-01-07 20:32:42 +01:00
parent 5bf6d7acbc
commit cd17ed372c
21 changed files with 88 additions and 66 deletions

View file

@ -1,34 +1,34 @@
- name: Create Syncthing app directory
file:
path: /srv/syncthing
path: "{{ service_dir }}"
state: directory
- name: Create Syncthing configuration directory
file:
path: /srv/syncthing/config
path: "{{ service_dir }}/config"
state: directory
- name: Copy Syncthing private key
copy:
src: "{{ role_path }}/files/key.pem"
dest: /srv/syncthing/config/key.pem
dest: "{{ service_dir }}/config/key.pem"
- name: Copy Syncthing certificate
copy:
src: "{{ role_path }}/files/cert.pem"
dest: /srv/syncthing/config/cert.pem
dest: "{{ service_dir }}/config/cert.pem"
- name: Copy Syncthing configuration
template:
src: "{{ role_path }}/templates/config.xml.j2"
dest: /srv/syncthing/config/config.xml
dest: "{{ service_dir }}/config/config.xml"
- name: Create Syncthing data directory
file:
path: /data/syncthing
path: "{{ data_dir }}"
state: directory
mode: 0777
- name: Copy Docker Compose script
copy:
src: "{{ role_path }}/files/docker-compose.yml"
dest: /srv/syncthing/docker-compose.yml
template:
src: "{{ role_path }}/templates/docker-compose.yml.j2"
dest: "{{ service_dir }}/docker-compose.yml"
- name: Start Docker Compose
docker_compose:
project_src: /srv/syncthing
project_src: "{{ service_dir }}"
pull: true
remove_orphans: true