ansible-collection-famedly-.../tasks/main.yml
Jan Christian Grünhage 23ce96e385 refactor config handling
The config files are now written to the app dir, not the version subdir.
They are still linked to the version subdir though.

Additionally, the container volumes for the config files are
autogenerated now
2020-02-17 01:58:34 +01:00

45 lines
1.4 KiB
YAML

---
- name: Create riot directory
file:
dest: "{{ riot_webapp_dir }}"
state: directory
- name: Download and install riot web app
import_tasks: download.yml
when: riot_deployment_method == "webroot"
- name: Write main configuration
copy:
content: "{{ riot_config | to_nice_json }}"
dest: "{{ riot_webapp_dir }}/config.json"
- name: Write domain specific configurations
copy:
content: "{{ item.config | to_nice_json }}"
dest: "{{ riot_webapp_dir }}/config.{{ item.domain }}.json"
loop: "{{ riot_domain_configs }}"
- name: Link main configuration
file:
src: "{{ riot_webapp_dir }}/config.json"
dest: "{{ riot_webapp_dir }}/riot-v{{ riot_version }}/config.json"
state: link
when: riot_deployment_method == "webroot"
- name: Link domain specific configurations
file:
src: "{{ riot_webapp_dir }}/config.{{ item.domain }}.json"
dest: "{{ riot_webapp_dir }}/riot-v{{ riot_version }}/config.{{ item.domain }}.json"
state: link
loop: "{{ riot_domain_configs }}"
when: riot_deployment_method == "webroot"
- name: Deploy docker container
docker_container:
name: "riot-web"
image: "docker.io/vectorim/riot-web:v{{ riot_version }}"
ports: "{{ riot_docker_ports }}"
labels: "{{ riot_docker_labels }}"
restart_policy: unless-stopped
volumes: "{{ riot_docker_volumes }}"
when: riot_deployment_method == "docker"