ansible-role-geoip/tasks/main.yml
2022-09-20 22:52:41 +02:00

36 lines
813 B
YAML

---
# tasks file for geoip
- name: Set up directories
ansible.builtin.file:
state: directory
path: "{{ item }}"
owner: "{{ ansible_user_id }}"
mode: '0755'
with_items:
- "{{ geoip_volume }}"
become: true
tags:
- configuration
- name: Write GeoIP configuration
ansible.builtin.template:
src: geoip.conf.j2
dest: "{{ geoip_volume }}/env.conf"
mode: '0600'
owner: "{{ ansible_user_id }}"
when: geoip_account_id and geoip_license_key
tags:
- configuration
- name: Install geoip
docker_container:
name: "geoip"
recreate: true
restart_policy: unless-stopped
image: "maxmindinc/geoipupdate"
env_file: "{{ geoip_volume }}/env.conf"
volumes:
- "{{ geoip_volume }}:/usr/share/GeoIP"
when: geoip_account_id and geoip_license_key