From 0f3b4dad7e351842278c1f24cb97464c2278b5ad Mon Sep 17 00:00:00 2001 From: Annika Merris Date: Fri, 9 May 2025 08:29:02 -0400 Subject: [PATCH] Sync --- .vscode/settings.json | 2 +- README.md | 2 +- .../{docker-compose.yml => docker-compose.yaml} | 0 .../minilab/roles/authentik/tasks/main.yaml | 4 ++-- .../minilab/roles/authentik/templates/env.j2 | 16 ++++++++++++++++ collections/requirements.yml | 7 ------- inventory/group_vars/all.yaml | 3 +-- inventory/host_vars/nemetona.yaml | 2 ++ inventory/hosts.yaml | 7 +++++++ minilab.yaml | 12 ++++++++++++ 10 files changed, 42 insertions(+), 13 deletions(-) rename collections/ansible_collections/adhdgirl/minilab/roles/authentik/files/{docker-compose.yml => docker-compose.yaml} (100%) create mode 100644 collections/ansible_collections/adhdgirl/minilab/roles/authentik/templates/env.j2 delete mode 100644 collections/requirements.yml create mode 100644 inventory/host_vars/nemetona.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json index 143dfdf..cbc727b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "ansible.python.interpreterPath": "/home/annika/ansible/minilab/.venv/bin/python" + "ansible.python.interpreterPath": "/workspace/dev/ansible/minilab/.venv/bin/python" } \ No newline at end of file diff --git a/README.md b/README.md index 0abd553..74f5565 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Adhdgirl Minilab Ansible Project +an# Adhdgirl Minilab Ansible Project ## To Get Machines Added diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/authentik/files/docker-compose.yml b/collections/ansible_collections/adhdgirl/minilab/roles/authentik/files/docker-compose.yaml similarity index 100% rename from collections/ansible_collections/adhdgirl/minilab/roles/authentik/files/docker-compose.yml rename to collections/ansible_collections/adhdgirl/minilab/roles/authentik/files/docker-compose.yaml diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/authentik/tasks/main.yaml b/collections/ansible_collections/adhdgirl/minilab/roles/authentik/tasks/main.yaml index 2720db3..92a4b49 100644 --- a/collections/ansible_collections/adhdgirl/minilab/roles/authentik/tasks/main.yaml +++ b/collections/ansible_collections/adhdgirl/minilab/roles/authentik/tasks/main.yaml @@ -30,8 +30,8 @@ mode: u=rw,g=r,o=r - name: Ensure environment file is available on the server tags: docker,authentik,settings - ansible.builtin.copy: - src: .env + ansible.builtin.template: + src: env.j2 dest: /opt/authentik/.env owner: root group: root diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/authentik/templates/env.j2 b/collections/ansible_collections/adhdgirl/minilab/roles/authentik/templates/env.j2 new file mode 100644 index 0000000..7615e6d --- /dev/null +++ b/collections/ansible_collections/adhdgirl/minilab/roles/authentik/templates/env.j2 @@ -0,0 +1,16 @@ +PG_PASS={{ authentik_pg_pass }} +AUTHENTIK_TAG=2025.4.0 +AUTHENTIK_SECRET_KEY={{authentik_secret_key}} +# SMTP Host Emails are sent to +AUTHENTIK_EMAIL__HOST=smtp.sendgrid.net +AUTHENTIK_EMAIL__PORT=587 +# Optionally authenticate (don't add quotation marks to your password) +AUTHENTIK_EMAIL__USERNAME={{ authentik_email__username }} +AUTHENTIK_EMAIL__PASSWORD={{ authentik_email__password }} +# Use StartTLS +AUTHENTIK_EMAIL__USE_TLS=true +# Use SSL +AUTHENTIK_EMAIL__USE_SSL=false +AUTHENTIK_EMAIL__TIMEOUT=10 +# Email address authentik will send from, should have a correct @domain +AUTHENTIK_EMAIL__FROM=authentik@moosenet.work diff --git a/collections/requirements.yml b/collections/requirements.yml deleted file mode 100644 index 6daef53..0000000 --- a/collections/requirements.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -collections: - - name: community.general - - name: ansible.posix - # - name: ansibleguy.nftables - # version: 1.0.3 - - name: community.docker diff --git a/inventory/group_vars/all.yaml b/inventory/group_vars/all.yaml index c1519a1..f141430 100644 --- a/inventory/group_vars/all.yaml +++ b/inventory/group_vars/all.yaml @@ -1,6 +1,5 @@ --- -#ansible_user: ansible -ansible_ssh_private_key_file: /home/annika/ansible/minilab/ansible_ed25519 +ansible_ssh_private_key_file: ./ansible_ed25519 debian_derivatives: - "Debian" - "Pop!_OS" diff --git a/inventory/host_vars/nemetona.yaml b/inventory/host_vars/nemetona.yaml new file mode 100644 index 0000000..31754b1 --- /dev/null +++ b/inventory/host_vars/nemetona.yaml @@ -0,0 +1,2 @@ +--- +server_name: nemetona diff --git a/inventory/hosts.yaml b/inventory/hosts.yaml index 85b21df..99c0b41 100644 --- a/inventory/hosts.yaml +++ b/inventory/hosts.yaml @@ -17,11 +17,14 @@ all: ansible_host: 10.69.11.5 stephanie: ansible_host: 10.69.11.51 + nemetona: + ansible_host: 10.69.11.52 children: alpine: hosts: adguard: stephanie: + nemetona: debian: hosts: maxim: @@ -36,6 +39,7 @@ all: pump: trady: stephanie: + nemetona: unifi_controller: hosts: pump: @@ -45,3 +49,6 @@ all: coder: hosts: stephanie: + authentik: + hosts: + nemetona: diff --git a/minilab.yaml b/minilab.yaml index 4167e81..f87081d 100644 --- a/minilab.yaml +++ b/minilab.yaml @@ -10,6 +10,12 @@ community.general.apk: update_cache: true when: ansible_distribution == "Alpine" + - name: Update package cache (Debian, and derivatives) + tags: always + ansible.builtin.apt: + update_cache: true + changed_when: false + when: ansible_distribution in debian_derivatives - name: Common tasks for all hosts hosts: all @@ -35,3 +41,9 @@ become: true roles: - adhdgirl.minilab.coder +- name: Configure authentik + hosts: authentik + tags: docker,authentik + become: true + roles: + - adhdgirl.minilab.authentik