From cb50373b94425473ad34bc7fcc0236003b181999 Mon Sep 17 00:00:00 2001 From: Ada Date: Mon, 25 Mar 2024 00:51:16 +0100 Subject: [PATCH] WIP --- ansible/roles/authentik/tasks/build.yml | 8 ++++---- .../roles/authentik/tasks/dependencies.yml | 19 +++++++++---------- ansible/roles/authentik/tasks/main.yml | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ansible/roles/authentik/tasks/build.yml b/ansible/roles/authentik/tasks/build.yml index a2b3bba..128ba15 100644 --- a/ansible/roles/authentik/tasks/build.yml +++ b/ansible/roles/authentik/tasks/build.yml @@ -1,7 +1,7 @@ --- - name: Get authentik source ansible.builtin.git: - repo: 'https://github.com/goauthentik/authentik.git' + repo: https://github.com/goauthentik/authentik.git dest: /opt/authentik/src version: version/2024.2.2 force: true @@ -16,7 +16,7 @@ npm run build - 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 ansible.builtin.shell: | @@ -26,7 +26,7 @@ - name: Build go proxy - ansible.builtin.shell: | + ansible.builtin.shell: |- cd /opt/authentik/src/ 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 - go build -o /opt/authentik/src/authentik-server ./cmd/server/ \ No newline at end of file + go build -o /opt/authentik/src/authentik-server ./cmd/server/ diff --git a/ansible/roles/authentik/tasks/dependencies.yml b/ansible/roles/authentik/tasks/dependencies.yml index 1477107..b277a2d 100644 --- a/ansible/roles/authentik/tasks/dependencies.yml +++ b/ansible/roles/authentik/tasks/dependencies.yml @@ -9,7 +9,7 @@ - name: Add deadsnake ppa for python3.12 ansible.builtin.apt_repository: - repo: 'ppa:deadsnakes/ppa' + repo: ppa:deadsnakes/ppa - name: Install python3.12 ansible.builtin.apt: @@ -22,16 +22,16 @@ - name: Add longsleep ppa for go 1.22 ansible.builtin.apt_repository: - repo: 'ppa:longsleep/golang-backports' + repo: ppa:longsleep/golang-backports - name: Install go 1.22 ansible.builtin.apt: - name: "golang-go" + name: golang-go - name: Download node GPG key ansible.builtin.get_url: - url: 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key' - dest: "/usr/share/keyrings/node-archive-keyring.asc" + url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key + dest: /usr/share/keyrings/node-archive-keyring.asc mode: "0644" validate_certs: true checksum: sha512:36c77b2bddaea0523ab90962a38ebd3ee90c3d5cf17e525f02898aa8e7b14fd1026f6d659b99d931fe907e9142a98ff08075ebfc56f0f1e2001c6ba4791d3daa @@ -40,7 +40,7 @@ - name: Add nodesource repo for node ansible.builtin.apt_repository: - repo: 'deb [arch=amd64 signed-by=/usr/share/keyrings/node-archive-keyring.asc] https://deb.nodesource.com/node_21.x nodistro main' + repo: deb [arch=amd64 signed-by=/usr/share/keyrings/node-archive-keyring.asc] https://deb.nodesource.com/node_21.x nodistro main - name: Install nodejs ansible.builtin.apt: @@ -48,13 +48,12 @@ - name: Add authentik user ansible.builtin.user: - name: "authentik" + name: authentik system: true - + - name: Create /opt/authentik ansible.builtin.file: path: /opt/authentik state: directory - mode: '0755' + mode: "0755" owner: authentik - diff --git a/ansible/roles/authentik/tasks/main.yml b/ansible/roles/authentik/tasks/main.yml index d809de1..1020310 100644 --- a/ansible/roles/authentik/tasks/main.yml +++ b/ansible/roles/authentik/tasks/main.yml @@ -3,7 +3,7 @@ ansible.builtin.import_tasks: dependencies.yml become: true tags: - - install_dependencies + - install_dependencies - name: Build authentik ansible.builtin.import_tasks: build.yml