diff --git a/config/ansible/tasks/servers/services/echoip/echoip.yml b/config/ansible/tasks/servers/services/echoip/echoip.yml index 472649c..933708a 100644 --- a/config/ansible/tasks/servers/services/echoip/echoip.yml +++ b/config/ansible/tasks/servers/services/echoip/echoip.yml @@ -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