Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
geoip_account_id:
geoip_license_key:
geoip_edition_ids:
- GeoLite2-Country
- GeoLite2-City

View File

@@ -0,0 +1,4 @@
---
- name: start geoipupdate
service: name=geoipupdate state=started

View File

@@ -0,0 +1,32 @@
---
- name: Install geoipupdate
yum:
name:
- geoipupdate
tags: geoip
- name: Deploy configuration
template: src=GeoIP.conf.j2 dest=/etc/GeoIP.conf mode=600
notify: start geoipupdate
tags: geoip
- name: Deploy geoipupdate units
template: src=geoipupdate.{{ item }}.j2 dest=/etc/systemd/system/geoipupdate.{{ item }}
loop:
- timer
- service
register: geoip_units
tags: geoip
- name: Reload systemd
systemd: daemon_reload=True
when: geoip_units.results | selectattr('changed', 'equalto', True) | list | length > 0
tags: geoip
- name: Handle geoip timer
systemd:
name: geoipupdate.timer
state: "{{ (geoip_account_id is defined and geoip_license_key is defined) | ternary('started', 'stopped') }}"
enabled: "{{ (geoip_account_id is defined and geoip_license_key is defined) | ternary(True, False) }}"
tags: geoip

View File

@@ -0,0 +1,4 @@
# {{ ansible_managed }}
AccountID {{ geoip_account_id | default('0000000') }}
LicenseKey {{ geoip_license_key | default('00000000') }}
EditionIDs {{ geoip_edition_ids | join(' ') }}

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Update MaxMind GeoIP databases
[Service]
Type=oneshot
ExecStart=/usr/bin/geoipupdate
TimeoutSec=600

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Update MaxMind GeoIP databases
[Timer]
OnCalendar=weekly
Persistent=yes
[Install]
WantedBy=timers.target