diff --git a/defaults/main.yml b/defaults/main.yml index cc9732e..22f890f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,6 +61,7 @@ authentik_volume_db: "{{ authentik_volume_base }}/db" authentik_volume_redis: "{{ authentik_volume_base }}/redis" # geoip credentials +authentik_geoip_container: true geoip_account_id: geoip_license_key: geoip_update_edition_ids: "GeoLite2-City GeoLite2-Country" diff --git a/tasks/main.yml b/tasks/main.yml index b1dd8fc..ff8b0f3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,7 +11,6 @@ - "{{ authentik_volume_certs }}" - "{{ authentik_volume_geoip }}" - "{{ authentik_volume_templates }}" - - "{{ authentik_volume_db }}" - "{{ authentik_volume_config }}" - "{{ authentik_volume_redis }}" - "~/authentik" @@ -19,6 +18,18 @@ - configuration become: false +- name: Set up the database directory. + file: + state: directory + path: "{{ item }}" + mode: 0755 + owner: 70 + with_items: + - "{{ authentik_volume_db }}" + tags: + - configuration + become: false + - name: Copy Authentik docker-compose template. ansible.builtin.template: src: templates/docker-compose.yml.j2 diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 2e2d31f..e91ac2b 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -75,9 +75,11 @@ services: - {{ authentik_volume_geoip }}:/geoip env_file: - {{ authentik_volume_config }}/env.authentik.conf +{% if authentik_geoip_container %} geoipupdate: image: "maxmindinc/geoipupdate:latest" volumes: - "{{ authentik_volume_geoip }}:/usr/share/GeoIP" env_file: - {{ authentik_volume_config }}/env.authentik.conf +{% endif %} \ No newline at end of file