diff --git a/defaults/main.yml b/defaults/main.yml index ba0dc00..087cf86 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -32,3 +32,8 @@ riot_config: servers: - matrix.org welcomeUserId: '@riot-bot:matrix.org' +riot_domain_configs: [] +riot_deployment_method: 'webroot' #alternative is 'docker' +riot_docker_ports: [] +riot_docker_labels: {} +riot_docker_volumes: {} diff --git a/tasks/main.yml b/tasks/main.yml index 9ff19dc..6073c28 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,8 +6,26 @@ - name: Download and install riot web app import_tasks: download.yml + when: riot_deployment_method == "webroot" -- name: Write configuration +- name: Write main configuration copy: content: "{{ riot_config | to_nice_json }}" dest: "{{ riot_webapp_dir }}/riot-v{{ riot_version }}/config.json" + +- name: Write domain specific configurations + copy: + content: "{{ item.config | to_nice_json }}" + dest: "{{ riot_webapp_dir }}/riot-v{{ riot_version }}/config.{{ item.domain }}.json" + loop: "riot_domain_configs" + +- name: Deploy docker container + docker_container: + docker_container: + name: "riot-web" + image: "docker.io/vectorim/riot-web:{{ riot_version }}" + ports: "{{ riot_docker_ports }}" + labels: "{{ riot_docker_labels }}" + restart_policy: unless-stopped + volumes: "{{ riot_docker_volumes }}" + when: riot_deployment_method == "docker"