Renamed server roles by osi they work on

This commit is contained in:
2025-07-10 12:33:46 +02:00
parent c94d623f8f
commit 96268e7161
120 changed files with 167 additions and 167 deletions

View File

@@ -0,0 +1,35 @@
# Nginx Domain Setup 🚀
## Description
This role bootstraps **per-domain Nginx configuration**: it requests TLS certificates, applies global modifiers, deploys a ready-made vHost file, and can optionally lock down access via OAuth2.
## Overview
A higher-level orchestration wrapper, *srv-proxy-6-6-domain* ties together several lower-level roles:
1. **`srv-web-7-7-inj-compose`** applies global tweaks and includes.
2. **`srv-web-6-6-tls-core`** obtains Lets Encrypt certificates.
3. **Domain template deployment** copies a Jinja2 vHost from *srv-proxy-7-4-core*.
4. **`web-app-oauth2-proxy`** *(optional)* protects the site with OAuth2.
The result is a complete, reproducible domain rollout in a single playbook task.
## Purpose
Provide **one-stop, idempotent domain provisioning** for Nginx-based homelabs or small production environments.
## Features
- **End-to-end TLS** — certificate retrieval and secure headers included.
- **Template-driven vHosts** — choose *basic* or *ws_generic* flavours (or your own).
- **Conditional OAuth2** — easily toggle authentication per application.
- **Handler-safe** — automatically triggers an Nginx reload when templates change.
- **Composable** — designed to be called repeatedly for many domains.
## Credits 📝
Developed and maintained by **Kevin Veen-Birkenbach**.
Learn more at <https://www.veen.world>
Part of the **CyMaIS Project** — licensed under the [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl)

View File

@@ -0,0 +1,5 @@
# default vhost flavour
vhost_flavour: "basic" # valid: basic | ws_generic
# build the full template path from the flavour
vhost_template_src: "roles/srv-proxy-7-4-core/templates/vhost/{{ vhost_flavour }}.conf.j2"

View File

@@ -0,0 +1,27 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Automated domain provisioning (TLS, vHost, OAuth2) for Nginx."
license: "CyMaIS NonCommercial License (CNCL)"
license_url: "https://s.veen.world/cncl"
company: |
Kevin Veen-Birkenbach
Consulting & Coaching Solutions
https://www.veen.world
min_ansible_version: "2.9"
platforms:
- name: Archlinux
versions:
- rolling
galaxy_tags:
- nginx
- tls
- letsencrypt
- oauth2
- automation
- archlinux
repository: https://s.veen.world/cymais
issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais
dependencies:
- srv-proxy-7-4-core

View File

@@ -0,0 +1,36 @@
- name: "include role for {{domain}} to receive certificates and do the modification routines"
include_role:
name: srv-web-7-6-composer
- name: "Copy nginx config to {{ configuration_destination }}"
template:
src: "{{ vhost_template_src }}"
dest: "{{ configuration_destination }}"
register: nginx_conf
notify: restart nginx
- name: "Check if {{ domains | get_domain(application_id) }} is reachable (only if config unchanged)"
uri:
url: "{{ domains | get_url(application_id, web_protocol) }}"
register: site_check
failed_when: false
changed_when: false
when: not nginx_conf.changed
- name: Restart nginx if site is down
command:
cmd: "true"
notify: restart nginx
when:
- not nginx_conf.changed
- site_check.status is defined
- not site_check.status in [200,301,302]
- name: "set oauth2_proxy_application_id (Needed due to lazzy loading issue)"
set_fact:
oauth2_proxy_application_id: "{{ application_id }}"
when: applications | is_feature_enabled('oauth2',application_id)
- name: "include the web-app-oauth2-proxy role {{domain}}"
include_tasks: "{{ playbook_dir }}/roles/web-app-oauth2-proxy/tasks/main.yml"
when: applications | is_feature_enabled('oauth2',application_id)

View File

@@ -0,0 +1 @@
configuration_destination: "{{nginx.directories.http.servers}}{{domain}}.conf"