Renamed general and mode constants and implemented a check to verify that constants are just defined ones over the whole repository

This commit is contained in:
2025-08-13 19:10:44 +02:00
parent 004507e233
commit db0e030900
171 changed files with 474 additions and 345 deletions

View File

@@ -6,12 +6,12 @@ Automates the creation of Nginx server blocks that redirect all `www.` subdomain
## Overview
This role will:
- **Discover** existing `*.conf` vhosts in your Nginx servers directory
- **Filter** domains with or without your `primary_domain`
- **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.
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. 🎯
@@ -20,5 +20,5 @@ Ensure that any request to `www.example.com` automatically and permanently redir
- **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 to `dedicated` and `mode_cleanup` is enabled. 🗑️
- **Debug Output**: Optional `enable_debug` gives detailed variable dumps for troubleshooting. 🐛
- **Cleanup Mode**: Removes the wildcard config file when `CERTBOT_FLAVOR` is set to `dedicated` and `MODE_CLEANUP` is enabled. 🗑️
- **Debug Output**: Optional `MODE_DEBUG` gives detailed variable dumps for troubleshooting. 🐛

View File

@@ -20,8 +20,8 @@
include_role:
name: srv-web-7-7-dns-records
vars:
cloudflare_api_token: "{{ certbot_dns_api_token }}"
cloudflare_api_token: "{{ CERTBOT_DNS_API_TOKEN }}"
cloudflare_domains: "{{ www_domains }}"
cloudflare_target_ip: "{{ networks.internet.ip4 }}"
cloudflare_proxied: false
when: dns_provider == 'cloudflare'
when: DNS_PROVIDER == 'cloudflare'