WIP: Add authentik roles #1

Draft
ada wants to merge 4 commits from authentik into main
3 changed files with 52 additions and 18 deletions
Showing only changes of commit f4109954e1 - Show all commits

View file

@ -7,26 +7,37 @@
force: true force: true
- name: Build front - name: Build front
ansible.builtin.shell: | ansible.builtin.shell:
cd /opt/authentik/src/website executable: /bin/bash
npm i cmd: |
npm run build-docs-only export NODE_ENV=production
cd /opt/authentik/src/web cd /opt/authentik/src/website
npm i npm ci --include=dev
npm run build npm run build-docs-only
cd /opt/authentik/src/web
npm ci --include=dev
npm run build
- name: Build go proxy
ansible.builtin.shell:
executable: /bin/bash
cmd: |
cd /opt/authentik/src/
go mod download
CGO_ENABLED=0 go build -o /opt/authentik/server ./cmd/server
- name: Create virtualenv - name: Create virtualenv
ansible.builtin.command: python3.12 -m venv /opt/authentik/src/venv ansible.builtin.command: python3.12 -m venv /opt/authentik/src/venv
- name: Installl poetry and dependencies - name: Installl poetry and dependencies
ansible.builtin.shell: | ansible.builtin.shell:
cd /opt/authentik/src/ executable: /bin/bash
venv/bin/pip install poetry cmd: |
venv/bin/poetry install --only=main --no-ansi --no-interaction --no-root cd /opt/authentik/src
source /opt/authentik/src/venv/bin/activate
export VENV_PATH=/opt/authentik/src/venv
- name: Build go proxy export POETRY_VIRTUALENVS_CREATE=false
ansible.builtin.shell: |- venv/bin/pip3 install --upgrade pip
cd /opt/authentik/src/ venv/bin/pip3 install poetry
sed -i "s/c.Setup(\".\/authentik\/lib\/default.yml\", \".\/local.env.yml\")/c.Setup(\"\/etc\/authentik\/config.yml\", \".\/authentik\/lib\/default.yml\", \".\/local.env.yml\")/" /opt/authentik/src/internal/config/config.go venv/bin/poetry venv use venv/python3.12
go build -o /opt/authentik/src/authentik-server ./cmd/server/ venv/bin/poetry install --only=main --no-ansi --no-interaction --no-root

View file

@ -1,9 +1,13 @@
--- ---
- name: Install roles dependencies - name: Install roles dependencies
ansible.builtin.apt: ansible.builtin.apt:
install_recommends: false
name: "{{ item }}" name: "{{ item }}"
with_items: with_items:
- git - git
- build-essential
- pkg-config
- zlib1g-dev
- libpq-dev - libpq-dev
- libxmlsec1-dev - libxmlsec1-dev

View file

@ -11,3 +11,22 @@
tags: tags:
- build - build
become_user: authentik become_user: authentik
- name: Create useful directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
owner: authentik
with_items:
- /opt/authentik/certs
- /opt/authentik/media
- /etc/authentik
- name: Test
ansible.builtin.copy:
remote_src: true
src: /opt/authentik/src/blueprints
dest: /opt/authentik/blueprints
owner: authentik
become: true