From 4a9c7ddee3aef1b74a140a3e8d4caf2a820e37d1 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 5 Oct 2016 10:36:10 +0200 Subject: [PATCH] library/roles/smartgears/smartgears: Fix the get-scopes script so that it takes the right port. --- smartgears/smartgears/tasks/smartgears-app.yml | 1 + smartgears/smartgears/templates/get-scopes.j2 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml index 5b252160..b52e32af 100644 --- a/smartgears/smartgears/tasks/smartgears-app.yml +++ b/smartgears/smartgears/tasks/smartgears-app.yml @@ -60,6 +60,7 @@ - name: Install the script that fetches the scope tokens template: src=get-scopes.j2 dest=/usr/local/bin/get-scopes owner=root group={{ smartgears_user }} mode=0750 + with_items: '{{ tomcat_m_instances }}' when: gcube_admin_token is defined tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ] diff --git a/smartgears/smartgears/templates/get-scopes.j2 b/smartgears/smartgears/templates/get-scopes.j2 index 463ee8e7..be2b45d0 100644 --- a/smartgears/smartgears/templates/get-scopes.j2 +++ b/smartgears/smartgears/templates/get-scopes.j2 @@ -5,11 +5,17 @@ TOKEN= {%if setup_nginx %} {%if https_port is defined %} +{% if http_redirect_to_https is defined and http_redirect_to_https %} HTTP_PORT={{ https_port }} {% else %} HTTP_PORT={{ http_port }} {% endif %} {% else %} +{%if http_port is defined %} +HTTP_PORT={{ http_port }} +{% endif %} +{% endif %} +{% else %} HTTP_PORT={{ item.http_port }} {% endif %}