ansible/roles/geoip/tasks/main.yml
Ryan Lerch 62952df107 ansiblelint fixes-- fqcn[action-core] - file to ansible.builtin.file
Replaces many references to  file: with ansible.builtin.file

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 10:41:52 +10:00

41 lines
1.1 KiB
YAML

---
# install python-geoIP
- name: Install python-GeoIP
package: name=python-GeoIP state=present
tags:
- packages
when: (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8) or (ansible_distribution_major_version|int < 30 and ansible_distribution == 'Fedora')
- name: Install python3-geoip2 (RHEL8)
package: name=python3-geoip2 state=present
tags:
- packages
when: (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int >= 8)
- name: Make sure the /usr/share/GeoIP/ directory exists
ansible.builtin.file:
path: /usr/share/GeoIP/
state: directory
owner: root
group: root
mode: "0755"
tags:
- geoip
- name: Push over the older geoip db
copy: src={{ item }} dest=/usr/share/GeoIP/
with_fileglob:
- "{{ bigfiles }}/geoip/*.dat"
tags:
- geoip
- name: Push over the newer geoip db
copy: src={{ item }} dest=/usr/share/GeoIP/
with_fileglob:
- "{{ bigfiles }}/geoip/*.mmdb"
tags:
- geoip
# comment out 2022-05-19. Script does not work since 2018.
# - name: Geoip syncing script via cron
# copy: src=geoip_sync dest=/etc/cron.d/geoip_sync mode=0644