From b09f380957c1969d4f978d37e169d5cc633ddbf7 Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Sat, 17 Sep 2022 18:47:53 +0200 Subject: [PATCH] DB directory has user 70 (docker). Optional install geoip container. --- defaults/main.yml | 1 + tasks/main.yml | 13 ++++++++++++- templates/docker-compose.yml.j2 | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) 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