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

Automatically download geoDNS database files

parent 78895277
No related branches found
No related tags found
No related merge requests found
inventory/group_vars/geodns.yml
.ssh/id_* .ssh/id_*
...@@ -25,3 +25,8 @@ During deploy, (Apache) virtualhost ServerNames will be generated by the followi ...@@ -25,3 +25,8 @@ During deploy, (Apache) virtualhost ServerNames will be generated by the followi
* proxy-[realm].[tld] * proxy-[realm].[tld]
Make sure you have DNS entries for those hostnames in geoDNS configuration. Make sure you have DNS entries for those hostnames in geoDNS configuration.
## geoDNS servers
To automatically download geoDNS GeoLite2DB's add a file ```geodns.yml``` to ```inventory/group_vars``` with the following content:
```geodns_licence: <your license key>```
...@@ -62,15 +62,20 @@ ...@@ -62,15 +62,20 @@
notify: notify:
- "enable geodns job" - "enable geodns job"
- name: Copy GeoLite2DB's - name: Download GeoLite2DB's
ansible.builtin.copy: ansible.builtin.unarchive:
src: "{{ item }}" src: "https://download.maxmind.com/app/geoip_download?edition_id={{ item }}&license_key={{ geodns_licence }}&suffix=tar.gz"
dest: "{{ geolite_dir }}" dest: "{{ geolite_dir }}"
mode: '0644' mode: '0644'
extra_opts: '--strip-components=1'
remote_src: yes
with_items: with_items:
- GeoLite2-Country.mmdb - GeoLite2-ASN
- GeoLite2-City
- GeoLite2-Country
notify: notify:
- "enable geodns job" - "enable geodns job"
when: geodns_licence is defined
- name: Create geoDNS config - name: Create geoDNS config
ansible.builtin.template: ansible.builtin.template:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment