mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-18 17:55:09 +02:00
- replaced CERTBOT_DNS_API_TOKEN with CLOUDFLARE_API_TOKEN everywhere - introduced generic sys-dns-cloudflare-records role for managing DNS records - added sys-dns-hetzner-rdns role with both Cloud (hcloud) and Robot API flavors - updated Mailu role to: - generate DKIM before DNS setup - delegate DNS + rDNS records to the new generic roles - removed legacy per-role Cloudflare vars (MAILU_CLOUDFLARE_API_TOKEN) - extended group vars with HOSTING_PROVIDER for rDNS flavor decision - added hetzner.hcloud collection to requirements This consolidates DNS management into reusable roles, supports both Cloudflare and Hetzner providers, and standardizes variable naming across the project.
Nginx WWW Redirect 🌐
Description
Automates the creation of Nginx server blocks that redirect all www.
subdomains to their non-www equivalents. Simple, idempotent, and SEO-friendly! 🚀
Overview
This role will:
- Discover existing
*.conf
vhosts in your Nginx servers directory - Filter domains with or without your
PRIMARY_DOMAIN
- Generate redirect rules via the
web-opt-rdr-domains
role - Optionally include a wildcard redirect template (experimental) ⭐️
- Clean up leftover configs when running in cleanup mode 🧹
All tasks are guarded by “run once” facts and MODE_CLEANUP
flags to avoid unintended re-runs or stale files.
Purpose
Ensure that any request to www.example.com
automatically and permanently redirects to https://example.com
, improving user experience, SEO, and certificate management. 🎯
Features
- Auto-Discovery: Scans your Nginx
servers
directory for.conf
files. 🔍 - Dynamic Redirects: Builds
source: "www.domain"
→target: "domain"
mappings on the fly. 🔧 - Wildcard Redirect: Includes a templated wildcard server block for
www.*
domains (toggleable). ✨ - Cleanup Mode: Removes the wildcard config file when
CERTBOT_FLAVOR
is set todedicated
andMODE_CLEANUP
is enabled. 🗑️ - Debug Output: Optional
MODE_DEBUG
gives detailed variable dumps for troubleshooting. 🐛