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
|
2026-01-08 16:56:19 +01:00
|
|
|
age_keyfile: "{{ lookup('env', 'SOPS_AGE_KEY_FILE') }}"
|
2026-01-05 16:40:37 +01:00
|
|
|
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: |
|
2026-01-08 16:56:19 +01:00
|
|
|
============================================================
|
|
|
|
|
🎉 Deployment complete for client: {{ client_name }}
|
|
|
|
|
============================================================
|
2026-01-05 16:40:37 +01:00
|
|
|
|
2026-01-08 16:56:19 +01:00
|
|
|
Services deployed and configured:
|
|
|
|
|
✓ Authentik SSO: https://{{ authentik_domain }}
|
|
|
|
|
✓ Nextcloud: https://nextcloud.{{ client_domain }}
|
|
|
|
|
✓ SSO Integration: Fully automated (OAuth2/OIDC)
|
2026-01-07 11:23:13 +01:00
|
|
|
|
2026-01-08 16:56:19 +01:00
|
|
|
Authentik Admin Access:
|
|
|
|
|
- Username: akadmin
|
|
|
|
|
- Password: {{ client_secrets.authentik_bootstrap_password }}
|
|
|
|
|
- API Token: Configured automatically
|
|
|
|
|
|
|
|
|
|
Nextcloud Admin Access:
|
|
|
|
|
- Username: {{ client_secrets.nextcloud_admin_user }}
|
|
|
|
|
- Password: {{ client_secrets.nextcloud_admin_password }}
|
|
|
|
|
|
|
|
|
|
End User Access:
|
|
|
|
|
1. Create users in Authentik: https://{{ authentik_domain }}
|
|
|
|
|
2. Users login to Nextcloud via "Login with Authentik" button
|
|
|
|
|
3. First login creates linked Nextcloud account automatically
|
|
|
|
|
|
|
|
|
|
============================================================
|
|
|
|
|
Ready to use! No manual configuration required.
|
|
|
|
|
============================================================
|