Skip to content
Snippets Groups Projects
Commit f41c420e authored by Martin van Es's avatar Martin van Es
Browse files

Rename altname to alias and realm_alias

parent a91af3f7
No related branches found
No related tags found
1 merge request!1Martin
...@@ -5,24 +5,24 @@ tld: srv.mdx.incubator.geant.org ...@@ -5,24 +5,24 @@ tld: srv.mdx.incubator.geant.org
proxies: proxies:
et2: et2:
hostname: srv1 hostname: srv1
altname: 'server-md2.et2.com' alias: 'server-md2.et2.com'
mdproxy: mdproxy:
test: test:
signer: 'http://localhost:5001' signer: 'http://localhost:5001'
altname: 'test-md.et2.com' realm_alias: 'test-md.et2.com'
edugain: edugain:
signer: 'http://srv2-signer.srv.mdx.incubator.geant.org' signer: 'http://srv2-signer.srv.mdx.incubator.geant.org'
altname: 'edugain-md.et2.com' realm_alias: 'edugain-md.et2.com'
mdxcdn: mdxcdn:
hostname: srv2 hostname: srv2
altname: 'server-md2.et2.com' alias: 'server-md2.et2.com'
mdproxy: mdproxy:
test: test:
signer: 'http://srv1-signer.srv.mdx.incubator.geant.org' signer: 'http://srv1-signer.srv.mdx.incubator.geant.org'
altname: 'test-md.foobar.com' realm_alias: 'test-md.foobar.com'
edugain: edugain:
signer: 'http://localhost:5001' signer: 'http://localhost:5001'
...@@ -32,15 +32,15 @@ proxies: ...@@ -32,15 +32,15 @@ proxies:
mdproxy: mdproxy:
test: test:
signer: 'http://srv1-signer.srv.mdx.incubator.geant.org' signer: 'http://srv1-signer.srv.mdx.incubator.geant.org'
altname: 'test-md.barfoo.com' realm_alias: 'test-md.barfoo.com'
edugain: edugain:
signer: 'http://srv2-signer.srv.mdx.incubator.geant.org' signer: 'http://srv2-signer.srv.mdx.incubator.geant.org'
alternative-mdx: alternative-mdx:
hostname: srv4 hostname: srv4
altname: 'server-md.example.com' alias: 'server-md.example.com'
mdproxy: mdproxy:
edugain: edugain:
signer: 'http://srv2-signer.srv.mdx.incubator.geant.org' signer: 'http://srv2-signer.srv.mdx.incubator.geant.org'
altname: 'edugain-md.blabla.com' realm_alias: 'edugain-md.blabla.com'
...@@ -5,6 +5,7 @@ signers_tld: srv.mdx.incubator.geant.org ...@@ -5,6 +5,7 @@ signers_tld: srv.mdx.incubator.geant.org
signers: signers:
et2: et2:
hostname: srv1 hostname: srv1
alias: mdx.et2.hu
mdsigner: mdsigner:
test: test:
name: hsm_signer name: hsm_signer
...@@ -12,6 +13,7 @@ signers: ...@@ -12,6 +13,7 @@ signers:
mdxcdn: mdxcdn:
hostname: srv2 hostname: srv2
alias: mdx.cdn.nl
mdsigner: mdsigner:
edugain: edugain:
name: hsm_signer name: hsm_signer
...@@ -19,6 +21,7 @@ signers: ...@@ -19,6 +21,7 @@ signers:
alternative-mdx: alternative-mdx:
hostname: srv3 hostname: srv3
alias: mdx.alternative.nl
mdsigner: mdsigner:
test: test:
name: normal_signer name: normal_signer
......
{% if signers is defined and signers[inventory_hostname].get('mdsigner') %} {% if signers is defined and signers[inventory_hostname].get('mdsigner') %}
# Signer configuration
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ signers[inventory_hostname]['hostname'] }}-signer.{{ signers_tld }} ServerName {{ signers[inventory_hostname]['hostname'] }}-signer.{{ signers_tld }}
{% if signers[inventory_hostname].get('altname') %} {% if signers[inventory_hostname].get('alias') %}
ServerAlias {{ signers[inventory_hostname]['altname'] }} ServerAlias {{ signers[inventory_hostname]['alias'] }}
{% endif %} {% endif %}
DocumentRoot /var/www/html DocumentRoot /var/www/html
AllowEncodedSlashes NoDecode AllowEncodedSlashes NoDecode
ProxyPass "/" "http://127.0.0.1:5001/" nocanon ProxyPass "/" "http://127.0.0.1:5001/" nocanon
ProxyPassReverse "/" "http://127.0.0.1:5001/" ProxyPassReverse "/" "http://127.0.0.1:5001/"
</VirtualHost> </VirtualHost>
{% endif %}
{% endif %}
{% if proxies is defined and proxies[inventory_hostname].get('mdproxy') %} {% if proxies is defined and proxies[inventory_hostname].get('mdproxy') %}
# Global proxy configuration
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ proxies[inventory_hostname]['hostname'] }}-proxy.{{ tld }} ServerName {{ proxies[inventory_hostname]['hostname'] }}-proxy.{{ tld }}
{% if proxies[inventory_hostname].get('alias') %}
ServerAlias {{ proxies[inventory_hostname]['alias'] }}
{% endif %}
DocumentRoot /var/www/html DocumentRoot /var/www/html
AllowEncodedSlashes NoDecode AllowEncodedSlashes NoDecode
ProxyPass "/" "http://127.0.0.1:5002/" nocanon ProxyPass "/" "http://127.0.0.1:5002/" nocanon
...@@ -21,11 +26,12 @@ ...@@ -21,11 +26,12 @@
</VirtualHost> </VirtualHost>
{% set mdproxy = proxies[inventory_hostname]['mdproxy'] %} {% set mdproxy = proxies[inventory_hostname]['mdproxy'] %}
# Realm specific proxy configuration
{% for realm, values in mdproxy.items() %} {% for realm, values in mdproxy.items() %}
<VirtualHost *:80> <VirtualHost *:80>
ServerName proxy-{{ realm }}.{{ tld }} ServerName proxy-{{ realm }}.{{ tld }}
{% if values.get('altname') %} {% if values.get('realm_alias') %}
ServerAlias {{ values['altname'] }} ServerAlias {{ values['realm_alias'] }}
{% endif %} {% endif %}
DocumentRoot /var/www/html DocumentRoot /var/www/html
AllowEncodedSlashes NoDecode AllowEncodedSlashes NoDecode
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
state: present state: present
name: name:
- netcat-openbsd - netcat-openbsd
- ansible
- name: Check if go binary exists - name: Check if go binary exists
stat: stat:
......
--- ---
- name: Install packages
apt:
state: present
name:
- ansible
- name: Clone MDX-SAAS-config repository - name: Clone MDX-SAAS-config repository
ansible.builtin.git: ansible.builtin.git:
......
...@@ -3,7 +3,4 @@ ...@@ -3,7 +3,4 @@
{% for realm, values in mdproxies.items() %} {% for realm, values in mdproxies.items() %}
{{ realm }}: {{ realm }}:
signer: {{ values['signer'] }} signer: {{ values['signer'] }}
{% if values.get('altname') %}
altname: {{ values['altname'] }}
{% endif %}
{% endfor %} {% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment