Commit d49df5dc authored by ale's avatar ale

Fix geoip-dataset templates

Properly support multiple datasets.
parent 4d827c04
Pipeline #6758 passed with stage
in 5 minutes and 56 seconds
- listen: trigger geoipupdate
shell: "/usr/bin/geoipupdate -f /etc/GeoIP_{{ item }}.conf"
shell: "/usr/bin/geoipupdate -f /etc/GeoIP.conf"
with_items: "{{ geoip_dataset }}"
......@@ -7,13 +7,12 @@
- name: Configure GeoIP downloader
template:
src: GeoIP.conf.j2
dest: "/etc/GeoIP_{{ item }}.conf"
dest: "/etc/GeoIP.conf"
when: geoip_account_id is defined
with_items: "{{ geoip_dataset }}"
notify: trigger geoipupdate
- name: Setup geoipupdate cron job
copy:
dest: "/etc/cron.d/geoipupdate_{{ item }}"
content: "12 0 * * 5 root /usr/local/bin/splay 3600 && /usr/bin/geoipupdate -f /etc/GeoIP_{{ item }}.conf"
with_items: "{{ geoip_dataset }}"
dest: "/etc/cron.d/geoipupdate"
content: "12 0 * * 5 root /usr/local/bin/splay 3600 && /usr/bin/geoipupdate -f /etc/GeoIP.conf"
......@@ -7,4 +7,6 @@ LicenseKey {{ geoip_license_key | default('000000000000') }}
# * GeoLite2-City - GeoLite 2 City
# * GeoLite2-Country - GeoLite2 Country
# For geoipupdate versions earlier than 2.5.0, use ProductIds here instead of EditionIDs.
EditionIDs GeoLite2-{{ geoip_dataset }}
{% for geoip_database in geoip_dataset %}
EditionIDs GeoLite2-{{ geoip_database }}
{% endfor %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment