From df49cb8049f0ba6ddb44db4bdc46b5d4f706b4d6 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Nov 2016 12:28:05 +0100 Subject: [PATCH] library/roles/smartgears/smartgears-nginx-frontend: Some smartgears nodes have aliases. Handle them in the virtualhost configuration. --- smartgears/smartgears-nginx-frontend/defaults/main.yml | 2 +- .../templates/generic-smartgears-virtualhost.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smartgears/smartgears-nginx-frontend/defaults/main.yml b/smartgears/smartgears-nginx-frontend/defaults/main.yml index 7c0abc0e..95fb2170 100644 --- a/smartgears/smartgears-nginx-frontend/defaults/main.yml +++ b/smartgears/smartgears-nginx-frontend/defaults/main.yml @@ -3,4 +3,4 @@ setup_nginx: False http_redirect_to_https: False letsencrypt_acme_install: False smartgears_install_generic_virthost: True - +#smartgears_nginx_serveraliases: diff --git a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 index a659e5f4..97b89556 100644 --- a/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 +++ b/smartgears/smartgears-nginx-frontend/templates/generic-smartgears-virtualhost.j2 @@ -3,7 +3,7 @@ server { {% if egi_image is defined and egi_image %} # No servername into the EGI images {% else %} - server_name {{ item.servername }}; + server_name {{ item.servername }} {% if smartgears_nginx_serveraliases is defined %}{% for vh in smartgears_nginx_serveraliases %} {{ vh }}{% endfor %}{% endif %}; {% endif %} {% if letsencrypt_acme_install %} include /etc/nginx/snippets/letsencrypt-proxy.conf; @@ -87,7 +87,7 @@ server { {% if egi_image is defined and egi_image %} # No servername into the EGI images {% else %} - server_name {{ item.servername }}; + server_name {{ item.servername }} {% if smartgears_nginx_serveraliases is defined %}{% for vh in smartgears_nginx_serveraliases %} {{ vh }}{% endfor %}{% endif %}; {% endif %} access_log /var/log/nginx/{{ item.servername }}_access_ssl.log;