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 %}