Files
computer-playbook/roles/sys-svc-cln-domains
Kevin Veen-Birkenbach 97af4990aa refactor(webserver): rename roles and update references
- Rename sys-svc-webserver -> sys-svc-webserver-core
- Rename sys-stk-front-pure -> sys-svc-webserver-https
- Update includes, run_once flags, and docs across:
  * sys-ctl-mtn-cert-renew
  * sys-front-inj-*
  * sys-stk-front-proxy
  * sys-svc-certs
  * sys-svc-cln-domains
  * web-opt-rdr-*
  * web-svc-*
- Remove redundant webserver include in web-opt-rdr-www
- Fix documentation links

Ref: ChatGPT conversation https://chatgpt.com/share/68d6cea2-3570-800f-acb3-c3277317f17b
2025-09-26 19:34:42 +02:00
..

sys-svc-cln-domains

Description

This Ansible role removes Nginx configuration files and revokes and deletes Certbot certificates for domains marked as deprecated.

Overview

Optimized for idempotent cleanup operations, this role:

  • Deletes Nginx server configuration files in /etc/nginx/conf.d/http/servers/ for each domain listed in deprecated_domains.
  • Revokes and deletes corresponding Certbot certificates.
  • Ensures cleanup tasks execute only once per playbook run.
  • Notifies Nginx to restart after removing configurations.

Purpose

Streamline the decommissioning of outdated or deprecated domains by automating the removal of Nginx server blocks and their SSL certificates.

Features

  • Nginx Cleanup: Safely removes server configuration files.
  • Certbot Integration: Revokes and deletes certificates without manual intervention.
  • Idempotent Execution: Utilizes a run_once flag to prevent repeated runs.
  • Service Notification: Triggers an Nginx restart handler upon cleanup.