From d66cd019d6a1315a62163329291f1d3a31355f7b Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Tue, 1 Oct 2019 22:52:37 -0300 Subject: [PATCH] use eumau/roundcube image + nginx auto config --- defaults/main.yml | 2 +- tasks/main.yml | 34 ++++++++++++---------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3185f79..3a5b9b2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,7 +4,7 @@ roundcube_domain: default roundcube_web_root: /roundcube # container -roundcube_image: roundcube/roundcubemail +roundcube_image: eumau/roundcubemail roundcube_container: roundcube roundcube_volume: roundcube diff --git a/tasks/main.yml b/tasks/main.yml index a735802..05a3d9b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -66,28 +66,18 @@ - name: "{{ docker_network_name }}" ports: -- name: template nginx domain config - when: roundcube_domain != 'default' - include_role: - name: nginx-docker - tasks_from: domain.yml - vars: - ng_domain_name: "{{ roundcube_domain }}" - -- name: template nginx location config - include_role: - name: nginx-docker - tasks_from: location.yml - vars: - ng_domain_name: "{{ roundcube_domain }}" - ng_location_name: "{{ roundcube_web_root }}" - ng_location_content: | - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://{{ roundcube_container }}/; - -- meta: flush_handlers +- name: export nginx config + set_fact: + nginx_config: >- + {{ nginx_config | default({}) | combine({ + roundcube_domain: { + "locations": { + roundcube_web_root: { + "proxy_pass": "http://{}:9000/".format(roundcube_container) + } + } + } + }) }} - name: inspect roundcube volume docker_volume_info: