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

Split apache proxy configuration for realms and add dns CNAME as altname

parent 87c47377
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,11 @@ Configuration repository for MDX as a service pilot ...@@ -5,11 +5,11 @@ Configuration repository for MDX as a service pilot
## Configuration ## Configuration
```inventory/inventory``` ```inventory/inventory```
* contains all the machines alt-mdx should be deployed to grouped by function * contains all the machines alt-mdx should be deployed to, grouped by function
```inventory/group_vars/all.yml``` ```inventory/group_vars/all.yml```
* contains the tlds and dns/server/proxy configuration for those machines * contains the tld and dns/server/proxy configuration for those machines
```files/[tld].yaml``` ```files/[tld].yaml```
......
...@@ -58,12 +58,12 @@ data: ...@@ -58,12 +58,12 @@ data:
- [ "193.224.22.78" ] - [ "193.224.22.78" ]
- [ "145.100.180.185" ] - [ "145.100.180.185" ]
- [ "62.217.72.109" ] - [ "62.217.72.109" ]
"proxy-eg": "proxy-edugain":
"a": "a":
- [ "193.224.22.78" ] - [ "193.224.22.78" ]
- [ "145.100.180.185" ] - [ "145.100.180.185" ]
- [ "62.217.72.109" ] - [ "62.217.72.109" ]
"proxy-tst": "proxy-test":
"a": "a":
- [ "193.224.22.78" ] - [ "193.224.22.78" ]
- [ "145.100.180.185" ] - [ "145.100.180.185" ]
......
--- ---
tlds: tld: srv.mdx.incubator.geant.org
- srv.mdx.incubator.geant.org
hosts: hosts:
et2.gndev.hexaa.eu: et2.gndev.hexaa.eu:
hostname: srv1 hostname: srv1
tld: srv.mdx.incubator.geant.org tld: srv.mdx.incubator.geant.org
mdserver: mdserver:
altname: 'server-md2.et2.com'
test: test:
signer: hsm_signer signer: hsm_signer
metadir: metadata/test metadir: metadata/test
mdproxy: mdproxy:
test: test:
signer: 'http://localhost:5001' signer: 'http://localhost:5001'
altname: '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'
mdxcdn.pt-38.utr.surfcloud.nl: mdxcdn.pt-38.utr.surfcloud.nl:
hostname: srv2 hostname: srv2
tld: srv.mdx.incubator.geant.org tld: srv.mdx.incubator.geant.org
mdserver: mdserver:
altname: 'server-md2.et2.com'
edugain: edugain:
signer: hsm_signer signer: hsm_signer
metadir: metadata/edugain metadir: metadata/edugain
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'
edugain: edugain:
signer: 'http://localhost:5001' signer: 'http://localhost:5001'
62.217.72.109: 62.217.72.109:
...@@ -32,15 +36,21 @@ hosts: ...@@ -32,15 +36,21 @@ hosts:
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'
edugain: edugain:
signer: 'http://srv2-signer.srv.mdx.incubator.geant.org' signer: 'http://srv2-signer.srv.mdx.incubator.geant.org'
alternative-mdx.pt-76.utr.surfcloud.nl: alternative-mdx.pt-76.utr.surfcloud.nl:
hostname: srv4 hostname: srv4
tld: srv.mdx.incubator.geant.org tld: srv.mdx.incubator.geant.org
mdserver: mdserver:
altname: 'server-md.example.com'
test: test:
signer: normal_signer signer: normal_signer
metadir: metadata/test metadir: metadata/test
mdproxy: mdproxy:
test: test:
signer: 'http://localhost:5001' signer: 'http://localhost:5001'
altname: 'test-md.blabla.com'
edugain:
signer: 'http://srv2-signer.srv.mdx.incubator.geant.org'
altname: 'edugain-md.blabla.com'
{% if hosts[inventory_hostname].get('mdserver') %}
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ hosts[inventory_hostname]['hostname'] }}-signer.{{ hosts[inventory_hostname]['tld'] }} ServerName {{ hosts[inventory_hostname]['hostname'] }}-signer.{{ hosts[inventory_hostname]['tld'] }}
ServerAlias signer.srv.mdx.incubator.geant.org {% if hosts[inventory_hostname]['mdserver'].get('altname') %}
ServerAlias {{ hosts[inventory_hostname]['mdserver']['altname'] }}
{% 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 %}
{% if hosts[inventory_hostname].get('mdproxy') %}
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ hosts[inventory_hostname]['hostname'] }}-proxy.{{ hosts[inventory_hostname]['tld'] }} ServerName {{ hosts[inventory_hostname]['hostname'] }}-proxy.{{ hosts[inventory_hostname]['tld'] }}
ServerAlias proxy.srv.mdx.incubator.geant.org
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
ProxyPassReverse "/" "http://127.0.0.1:5002/" ProxyPassReverse "/" "http://127.0.0.1:5002/"
</VirtualHost> </VirtualHost>
{% endif %}
{% if hosts[inventory_hostname].get('mdproxy') %}
{% set mdproxy = hosts[inventory_hostname]['mdproxy'] %}
{% for realm, values in mdproxy.items() %}
<VirtualHost *:80>
ServerName proxy-{{ realm }}.{{ hosts[inventory_hostname]['tld'] }}
{% if values.get('altname') %}
ServerAlias {{ values['altname'] }}
{% endif %}
DocumentRoot /var/www/html
AllowEncodedSlashes NoDecode
ProxyPass "/" "http://127.0.0.1:5002/{{ realm }}" nocanon
ProxyPassReverse "/" "http://127.0.0.1:5002/{{ realm }}"
</VirtualHost>
{% endfor %}
{% endif %}
...@@ -43,12 +43,11 @@ ...@@ -43,12 +43,11 @@
- name: Copy geoDNS config - name: Copy geoDNS config
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ lookup('file', item + '.yaml') | from_yaml | to_nice_json }}" content: "{{ lookup('file', tld + '.yaml') | from_yaml | to_nice_json }}"
dest: "{{ geo_dns_config }}/{{ item }}.json" dest: "{{ geo_dns_config }}/{{ tld }}.json"
mode: '0644' mode: '0644'
notify: notify:
- "enable geodns job" - "enable geodns job"
with_list: "{{ tlds }}"
- name: Copy GeoLite2DB's - name: Copy GeoLite2DB's
ansible.builtin.copy: ansible.builtin.copy:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment