fix: update database movement and cleanup tasks for EchoIP service
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 13s
Nix Format Check / check-format (push) Successful in 1m2s
Python Lint Check / check-python (push) Failing after 10s

This commit is contained in:
Menno van Leeuwen 2025-03-26 16:26:53 +01:00
parent 57de662fff
commit 0b54e1b534
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -85,17 +85,17 @@
# Move all databases to the correct locations
- name: Move ASN database to correct location
ansible.builtin.command:
cmd: "mv {{ echoip_data_dir }}/GeoLite2-ASN/GeoLite2-ASN.mmdb {{ echoip_data_dir }}/GeoLite2-ASN.mmdb"
cmd: "find {{ echoip_data_dir }}/GeoLite2-ASN -name GeoLite2-ASN.mmdb -exec mv {} {{ echoip_data_dir }}/GeoLite2-ASN.mmdb \\;"
when: asn_extracted.changed
- name: Move City database to correct location
ansible.builtin.command:
cmd: "mv {{ echoip_data_dir }}/GeoLite2-City/GeoLite2-City.mmdb {{ echoip_data_dir }}/GeoLite2-City.mmdb"
cmd: "find {{ echoip_data_dir }}/GeoLite2-City -name GeoLite2-City.mmdb -exec mv {} {{ echoip_data_dir }}/GeoLite2-City.mmdb \\;"
when: city_extracted.changed
- name: Move Country database to correct location
ansible.builtin.command:
cmd: "mv {{ echoip_data_dir }}/GeoLite2-Country/GeoLite2-Country.mmdb {{ echoip_data_dir }}/GeoLite2-Country.mmdb"
cmd: "find {{ echoip_data_dir }}/GeoLite2-Country -name GeoLite2-Country.mmdb -exec mv {} {{ echoip_data_dir }}/GeoLite2-Country.mmdb \\;"
when: country_extracted.changed
# Clean up unnecessary files
@ -105,9 +105,8 @@
state: absent
- name: Remove extracted ASN folder
ansible.builtin.file:
path: "{{ echoip_data_dir }}/GeoLite2-ASN"
state: absent
ansible.builtin.command:
cmd: "rm -rf {{ echoip_data_dir }}/GeoLite2-ASN"
- name: Remove downloaded City tar.gz file
ansible.builtin.file:
@ -115,9 +114,8 @@
state: absent
- name: Remove extracted City folder
ansible.builtin.file:
path: "{{ echoip_data_dir }}/GeoLite2-City"
state: absent
ansible.builtin.command:
cmd: "rm -rf {{ echoip_data_dir }}/GeoLite2-City"
- name: Remove downloaded Country tar.gz file
ansible.builtin.file:
@ -125,9 +123,8 @@
state: absent
- name: Remove extracted Country folder
ansible.builtin.file:
path: "{{ echoip_data_dir }}/GeoLite2-Country"
state: absent
ansible.builtin.command:
cmd: "rm -rf {{ echoip_data_dir }}/GeoLite2-Country"
# Deploy and restart the EchoIP service
- name: Deploy EchoIP docker-compose.yml