--- - name: Create authentik directory ansible.builtin.file: path: "{{ authentik_dir }}" state: directory owner: root group: root mode: "0755" tags: [authentik] - name: Render authentik environment ansible.builtin.template: src: env.j2 dest: "{{ authentik_dir }}/.env" owner: root group: root mode: "0600" no_log: true tags: [authentik, config] - name: Ensure authentik proxy network exists community.docker.docker_network: name: "{{ authentik_traefik_network }}" state: present when: authentik_routing_mode == "traefik" tags: [authentik, docker] - name: Render authentik Compose file ansible.builtin.template: src: compose.yaml.j2 dest: "{{ authentik_dir }}/compose.yaml" owner: root group: root mode: "0644" notify: restart authentik tags: [authentik, compose] - name: Allow authentik ports community.general.ufw: rule: allow port: "{{ item }}" proto: tcp loop: "{{ authentik_tcp_ports }}" when: authentik_routing_mode == "host" tags: [authentik, firewall] - name: Start authentik community.docker.docker_compose_v2: project_src: "{{ authentik_dir }}" state: present tags: [authentik, compose]