2026-01-05 16:40:37 +01:00
|
|
|
---
|
|
|
|
|
# Deploy applications to client servers
|
2026-01-07 11:23:13 +01:00
|
|
|
# This playbook deploys Authentik, Nextcloud, and other applications
|
2026-01-05 16:40:37 +01:00
|
|
|
|
|
|
|
|
- name: Deploy applications to client servers
|
|
|
|
|
hosts: all
|
|
|
|
|
become: yes
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
|
- name: Gather facts
|
|
|
|
|
setup:
|
|
|
|
|
|
|
|
|
|
- name: Determine client name from hostname
|
|
|
|
|
set_fact:
|
|
|
|
|
client_name: "{{ inventory_hostname }}"
|
|
|
|
|
|
|
|
|
|
- name: Load client secrets
|
|
|
|
|
community.sops.load_vars:
|
|
|
|
|
file: "{{ playbook_dir }}/../../secrets/clients/{{ client_name }}.sops.yaml"
|
|
|
|
|
name: client_secrets
|
|
|
|
|
age_key: "{{ lookup('env', 'SOPS_AGE_KEY_FILE') }}"
|
|
|
|
|
no_log: true
|
|
|
|
|
|
2026-01-06 09:30:54 +01:00
|
|
|
- name: Set client domain from secrets
|
|
|
|
|
set_fact:
|
|
|
|
|
client_domain: "{{ client_secrets.client_domain }}"
|
|
|
|
|
when: client_secrets.client_domain is defined
|
|
|
|
|
|
2026-01-07 11:23:13 +01:00
|
|
|
- name: Set Authentik domain from secrets
|
|
|
|
|
set_fact:
|
|
|
|
|
authentik_domain: "{{ client_secrets.authentik_domain }}"
|
|
|
|
|
when: client_secrets.authentik_domain is defined
|
|
|
|
|
|
2026-01-05 16:40:37 +01:00
|
|
|
roles:
|
2026-01-07 11:23:13 +01:00
|
|
|
- role: authentik
|
2026-01-06 09:30:54 +01:00
|
|
|
- role: nextcloud
|
2026-01-05 16:40:37 +01:00
|
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
|
- name: Display deployment summary
|
|
|
|
|
debug:
|
|
|
|
|
msg: |
|
|
|
|
|
Deployment complete for client: {{ client_name }}
|
|
|
|
|
|
2026-01-07 11:23:13 +01:00
|
|
|
Authentik SSO: https://{{ authentik_domain }}
|
2026-01-06 09:30:54 +01:00
|
|
|
Nextcloud: https://nextcloud.{{ client_domain }}
|
2026-01-07 11:23:13 +01:00
|
|
|
|
|
|
|
|
Next steps:
|
|
|
|
|
1. Complete Authentik initial setup at: https://{{ authentik_domain }}/if/flow/initial-setup/
|
|
|
|
|
2. Create OAuth2/OIDC provider for Nextcloud in Authentik
|
|
|
|
|
3. Configure Nextcloud to use Authentik for SSO
|