Compare commits

..

No commits in common. "0fc9c3e495c90012a1479ab6668bec590293a82b" and "fb96c5b7fb24e34eb25a479c03c14fff527d6195" have entirely different histories.

45 changed files with 90 additions and 653 deletions

View File

@ -19,7 +19,7 @@ This command will setup CyMaIS on your system with the alias **cymais**.
## Get Help ## Get Help
After you setuped CyMaIS you can receive more help by executing: After you setuped CyMaIS you can recieve more help by executing:
```bash ```bash
cymais --help cymais --help

View File

@ -88,9 +88,3 @@ enable_wildcard_certificate: false
# This enables debugging in ansible and in the apps # This enables debugging in ansible and in the apps
# You SHOULD NOT enable this on production servers # You SHOULD NOT enable this on production servers
enable_debug: false enable_debug: false
# Which ACME method to use: webroot, cloudflare, or hetzner
certbot_acme_challenge_method: "webroot"
certbot_credentials_dir: /etc/certbot
certbot_credentials_file: "{{ certbot_credentials_dir }}/{{ certbot_acme_challenge_method }}.ini"
# certbot_dns_api_token # Define in inventory file

View File

@ -45,7 +45,6 @@ defaults_domains:
roulette-wheel: "roulette.{{primary_domain}}" roulette-wheel: "roulette.{{primary_domain}}"
snipe_it: "inventory.{{primary_domain}}" snipe_it: "inventory.{{primary_domain}}"
sphinx: "docs.{{primary_domain}}" sphinx: "docs.{{primary_domain}}"
syncope: "syncope.{{primary_domain}}"
taiga: "kanban.{{primary_domain}}" taiga: "kanban.{{primary_domain}}"
yourls: "s.{{primary_domain}}" yourls: "s.{{primary_domain}}"
# ATTENTION: Will be owerwritten by the values in domains. Not merged. # ATTENTION: Will be owerwritten by the values in domains. Not merged.

View File

@ -56,7 +56,6 @@ ports:
fusiondirectory: 8038 fusiondirectory: 8038
presentation: 8039 presentation: 8039
espocrm: 8040 espocrm: 8040
syncope: 8041
bigbluebutton: 48087 # This port is predefined by bbb. @todo Try to change this to a 8XXX port bigbluebutton: 48087 # This port is predefined by bbb. @todo Try to change this to a 8XXX port
# Ports which are exposed to the World Wide Web # Ports which are exposed to the World Wide Web
public: public:

View File

@ -82,8 +82,6 @@ defaults_networks:
subnet: 192.168.103.48/28 subnet: 192.168.103.48/28
espocrm: espocrm:
subnet: 192.168.103.64/28 subnet: 192.168.103.64/28
syncope:
subnet: 192.168.103.80/28
# /24 Networks / 254 Usable Clients # /24 Networks / 254 Usable Clients
bigbluebutton: bigbluebutton:

View File

@ -1,32 +0,0 @@
# Certbot
## 🔥 Description
This Ansible role automates the installation and configuration of [Certbot](https://certbot.eff.org/), a free and open-source tool for automating the deployment of [Let's Encrypt](https://letsencrypt.org/) certificates. It also handles the setup of DNS plugins for ACME challenges.
## 📖 Overview
Optimized for Archlinux, this role ensures secure SSL/TLS certificate generation with minimal manual intervention. It supports both `webroot` and `DNS-01` validation methods, providing flexibility based on your infrastructure needs.
### Key Features
- **Automatic Installation:** Installs `certbot` and the necessary DNS plugin via pacman.
- **Dynamic DNS Plugin Support:** Automatically installs the correct `certbot-dns-<provider>` package based on your selected challenge method.
- **Credential Management:** Creates secure credential files for DNS API tokens when using DNS-01 validation.
- **Idempotent Execution:** Tasks are intelligently executed only once per playbook run.
## 🎯 Purpose
The Certbot role provides a ready-to-use, automated solution for SSL/TLS management in your infrastructure. Whether you're managing traditional servers or containerized environments, this role ensures your certificates are always in place and valid.
## 🚀 Features
- **Certbot Installation:** Ensures the latest version of Certbot is installed.
- **DNS Plugin Installation:** Installs a matching plugin based on your configured ACME challenge method.
- **Credential Directory Management:** Creates a secured `/etc/certbot` directory with proper permissions.
- **API Token File Setup:** Manages API token files securely for DNS challenge authentication.
## 🔗 Learn More
- [Certbot Official Website](https://certbot.eff.org/)
- [Let's Encrypt](https://letsencrypt.org/)
- [ACME Challenge Types (Wikipedia)](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment)

View File

@ -1,28 +0,0 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Automates the installation and configuration of Certbot for SSL/TLS certificate management"
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:
- certbot
- ssl
- tls
- https
- encryption
- letsencrypt
- acme
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies: []

View File

@ -1,41 +0,0 @@
- name: install certbot
pacman:
name: certbot
state: present
when: run_once_certbot is not defined
- name: install certbot DNS plugin
pacman:
name: "certbot-dns-{{ certbot_acme_challenge_method }}"
state: present
when:
- run_once_certbot is not defined
- certbot_acme_challenge_method != 'webroot'
- name: Ensure /etc/certbot directory exists
file:
path: "{{ certbot_credentials_dir }}"
state: directory
owner: root
group: root
mode: '0755'
when:
- run_once_certbot is not defined
- certbot_acme_challenge_method != 'webroot'
- name: Install plugin credentials file
copy:
dest: "{{ certbot_credentials_file }}"
content: |
dns_{{ certbot_acme_challenge_method }}_api_token = {{ certbot_dns_api_token }}
owner: root
group: root
mode: '0600'
when:
- run_once_certbot is not defined
- certbot_acme_challenge_method != 'webroot'
- name: run the certbot role once
set_fact:
run_once_certbot: true
when: run_once_certbot is not defined

View File

@ -3,7 +3,7 @@
include_role: include_role:
name: docker-central-database name: docker-central-database
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all
vars: vars:

View File

@ -4,5 +4,5 @@ database_name: "{{ application_id }}"
database_username: "{{ application_id }}" database_username: "{{ application_id }}"
database_port: "{{ 3306 if database_type == 'mariadb' else 5432 }}" database_port: "{{ 3306 if database_type == 'mariadb' else 5432 }}"
database_env: "{{docker_compose.directories.env}}{{database_type}}.env" database_env: "{{docker_compose.directories.env}}{{database_type}}.env"
database_url_jdbc: "jdbc:{{ database_type if database_type == 'mariadb' else 'postgresql' }}://{{ database_host }}:{{ database_port }}/{{ database_name }}"
database_url_full: "{{database_type}}://{{database_username}}:{{database_password}}@{{database_host}}:{{database_port}}/{{ database_name }}" # Don't set application_id . It would conflict with central database logic

View File

@ -118,4 +118,4 @@ LDAP_ROOT_DN = "{{ldap.dn.root}}"
FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/front/dist FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/front/dist
DATABASE_URL = {{ database_url_full }} DATABASE_URL = postgresql://{{database_username}}:{{database_password}}@{{database_host}}:{{database_port}}/{{ database_name }}

View File

@ -13,7 +13,7 @@ KC_METRICS_ENABLED= true
KEYCLOAK_ADMIN= "{{applications.keycloak.users.administrator.username}}" KEYCLOAK_ADMIN= "{{applications.keycloak.users.administrator.username}}"
KEYCLOAK_ADMIN_PASSWORD= "{{applications.keycloak.administrator_password}}" KEYCLOAK_ADMIN_PASSWORD= "{{applications.keycloak.administrator_password}}"
KC_DB= postgres KC_DB= postgres
KC_DB_URL= {{database_url_jdbc}} KC_DB_URL= jdbc:postgresql://{{database_host}}/{{database_name}}
KC_DB_USERNAME= {{database_username}} KC_DB_USERNAME= {{database_username}}
KC_DB_PASSWORD= {{database_password}} KC_DB_PASSWORD= {{database_password}}

View File

@ -11,12 +11,7 @@
command: command:
cmd: 'docker compose exec -u root web bash -c "RAILS_ENV=production bin/tootctl accounts create {{users.administrator.username}} --email {{users.administrator.email}} --confirmed --role Owner"' cmd: 'docker compose exec -u root web bash -c "RAILS_ENV=production bin/tootctl accounts create {{users.administrator.username}} --email {{users.administrator.email}} --confirmed --role Owner"'
chdir: "{{docker_compose.directories.instance}}" chdir: "{{docker_compose.directories.instance}}"
register: tootctl_create ignore_errors: true
changed_when: tootctl_create.rc == 0
failed_when: >
tootctl_create.rc != 0
and
("taken" not in tootctl_create.stderr | lower)
- name: Approve the administrator account in Mastodon - name: Approve the administrator account in Mastodon
command: command:

View File

@ -3,7 +3,7 @@
include_role: include_role:
name: docker-central-database name: docker-central-database
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all
vars: vars:

View File

@ -1,4 +1,4 @@
{# receives https certificate and setup proxy with domain replace #} {# Recieves https certificate and setup proxy with domain replace #}
- name: "include role receive certbot certificate" - name: "include role receive certbot certificate"
include_role: include_role:

View File

@ -2,8 +2,8 @@
Details on specific apps like Cospend, including related SQL queries and debugging tips. Details on specific apps like Cospend, including related SQL queries and debugging tips.
## receive Plugin Information ## Recieve Plugin Information
To receive the relevant configuration options for a plugin type: To recieve the relevant configuration options for a plugin type:
```bash ```bash
docker compose exec -u www-data application php occ config:list oidc_login docker compose exec -u www-data application php occ config:list oidc_login
``` ```

View File

@ -19,7 +19,7 @@
# Not all type of changes take instantly place. Due to this reason a rebuild is required. # Not all type of changes take instantly place. Due to this reason a rebuild is required.
notify: docker compose project setup notify: docker compose project setup
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all

View File

@ -11,7 +11,7 @@ OPENPROJECT_HOST__NAME={{domains[application_id]}}
OPENPROJECT_RAILS__RELATIVE__URL__ROOT= OPENPROJECT_RAILS__RELATIVE__URL__ROOT=
IMAP_ENABLED=false IMAP_ENABLED=false
POSTGRES_PASSWORD="{{ database_password }}" POSTGRES_PASSWORD="{{ database_password }}"
DATABASE_URL="{{ database_url_full }}?pool=20&encoding=unicode&reconnect=true" DATABASE_URL="postgres://{{ database_username }}:{{ database_password }}@{{database_host}}/{{database_name}}?pool=20&encoding=unicode&reconnect=true"
RAILS_MIN_THREADS=4 RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16 RAILS_MAX_THREADS=16
OPENPROJECT_HSTS=true OPENPROJECT_HSTS=true

View File

@ -1,4 +1,4 @@
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all

View File

@ -1,35 +0,0 @@
# Syncope (DRAFT)
## 🔥 Description
[Apache Syncope](https://syncope.apache.org/) is a powerful and flexible open-source system for managing digital identities in enterprise environments. It offers Identity Governance and Administration (IGA) capabilities, including user provisioning, role management, auditing, workflow integration, and more. Syncope is designed to handle complex identity life cycles across multiple systems, both on-premise and in the cloud.
This role deploys Apache Syncope using Docker Compose, automating the setup of its core services, database, and reverse proxy integration.
## 📖 Overview
Optimized for Archlinux, this role brings up a fully functional Syncope stack based on the official [Docker Compose samples](https://syncope.apache.org/docs/getting-started.html#docker-compose-samples). It includes all core components like Syncope Core, Console, and Enduser, with secure environment management and HTTPS integration.
### Key Features
- **Complete Identity Management:** Centralized user, group, and policy management.
- **Extensible Architecture:** Integrates easily with external identity providers (LDAP, Active Directory, etc.).
- **Modern Interfaces:** Provides REST APIs and web consoles for administrators and end-users.
- **Open Standards Support:** SAML 2.0, OAuth 2.0, OpenID Connect, SCIM.
## 🎯 Purpose
The Syncope (Docker Deployment) role provides a fully automated environment for testing, development, or production setups of Apache Syncope, simplifying the complexities of IAM deployment.
## 🚀 Features
- **PostgreSQL Database Setup:** Integrated database management for Syncope.
- **Syncope Core + Console + Enduser Deployment:** All critical services brought up automatically.
- **Nginx Reverse Proxy with SSL:** Secured access with HTTPS termination.
- **Credential and Secrets Management:** Handles sensitive user credentials securely.
- **Customizable Paths and Environment:** Easy adjustment for your domain and access paths.
## 🔗 Learn More
- [Apache Syncope Official Website](https://syncope.apache.org/)
- [Apache Syncope Documentation](https://syncope.apache.org/docs/)
- [Identity Management (Wikipedia)](https://en.wikipedia.org/wiki/Identity_management)

View File

@ -1,2 +0,0 @@
# Todos
- Implement this draft

View File

@ -1,28 +0,0 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: |
Apache Syncope is an open-source Identity and Access Management (IAM) system, offering centralized identity governance, user provisioning, role management, and workflow integration.
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:
- docker
- syncope
- iam
- identity
- management
- nginx
- https
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"

View File

@ -1,31 +0,0 @@
---
- name: "include docker-central-database"
include_role:
name: docker-central-database
- name: "include role for {{application_id}} to receive certs & do modification routines"
include_role:
name: nginx-https-get-cert-modify-all
- name: configure {{domain}}.conf
template:
src: "templates/proxy.conf.j2"
dest: "{{nginx.directories.http.servers}}{{domain}}.conf"
notify: restart nginx
- name: configure {{domain}}.conf
template:
src: "templates/proxy.conf.j2"
dest: "{{nginx.directories.http.servers}}{{domain}}.conf"
notify: restart nginx
- name: "create {{docker_compose.files.env}}"
template:
src: "database.j2"
dest: "{{docker_compose.files.env}}"
mode: '770'
force: yes
notify: docker compose project setup
- name: "copy docker-compose.yml and env file"
include_tasks: copy-docker-compose-and-env.yml

View File

@ -1,5 +0,0 @@
DB_URL={{ database_url_jdbc }}?stringtype=unspecified
DB_USER=DB_URL={{ database_username }}
DB_PASSWORD={{ database_password }}
DB_POOL_MAX=20
DB_POOL_MIN=5

View File

@ -1,40 +0,0 @@
services:
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
application:
depends_on:
- db
image: apache/syncope:{{ applications[application_id].version }}
ports:
- "18080:8080"
restart: always
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
environment:
SPRING_PROFILES_ACTIVE: docker,postgresql,saml2
OPENJPA_REMOTE_COMMIT: sjvm
SERVICE_DISCOVERY_ADDRESS: {{ web_protocol }}://{{ domains[application_id] }}/{{syncope_paths[rest]}}/
# database variablen auslesen
console:
depends_on:
- syncope
image: apache/syncope-console:{{ applications[application_id].version }}
ports:
- "28080:8080"
restart: always
environment:
SPRING_PROFILES_ACTIVE: docker,saml2
SERVICE_DISCOVERY_ADDRESS: {{ web_protocol }}://{{ domains[application_id] }}/{{syncope_paths[console]}}/
enduser:
depends_on:
- syncope
image: apache/syncope-enduser:{{ applications[application_id].version }}
ports:
- "38080:8080"
restart: always
environment:
SPRING_PROFILES_ACTIVE: docker,saml2
SERVICE_DISCOVERY_ADDRESS: {{ web_protocol }}://{{ domains[application_id] }}/{{syncope_paths[enduser]}}/

View File

@ -1,12 +0,0 @@
# Default variables
KEYMASTER_USERNAME={{ syncope_anonymous_user }}
KEYMASTER_PASSWORD={{ syncope_anonymous_password }}
ANONYMOUS_USER={{ syncope_anonymous_user }}
ANONYMOUS_KEY={{ syncope_anonymous_password }}
KEYMASTER_ADDRESS={{ syncope_keymaster_address }}
# Spring Boot Variables
# @See https://docs.spring.io/spring-boot/docs/2.0.9.RELEASE/reference/html/boot-features-external-config.html
SECURITY_ADMINUSER={{ syncope_administrator_user }}
SECURITY_ADMINPASSWORD={{ syncope_administrator_password }}

View File

@ -1,22 +0,0 @@
server
{
server_name {{domain}};
{% if applications | get_oauth2_enabled(application_id) %}
{% include 'roles/docker-oauth2-proxy/templates/endpoint.conf.j2'%}
{% endif %}
{% include 'roles/nginx-modifier-all/templates/global.includes.conf.j2'%}
{% if nginx_docker_reverse_proxy_extra_configuration is defined %}
{# Additional Domain Specific Configuration #}
{{nginx_docker_reverse_proxy_extra_configuration}}
{% endif %}
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
{% for path in syncope_paths.values() %}
{% set location = web_protocol ~ '://' ~ domains[application_id] ~ '/' ~ path ~ '/' %}
{% include 'roles/nginx-docker-reverse-proxy/templates/location/proxy_basic.conf.j2'%}
{% endfor %}
}

View File

@ -1,17 +0,0 @@
# General Configuration
application_id: syncope
database_type: "postgres"
database_password: {{ domains[application_id].credentials.database.password }}
# Application Specific
syncope_keymaster_address: http://localhost:8080/syncope/rest/keymaster
syncope_paths:
rest: rest
console: console
enduser: enduser
syncope_anonymous_user: {{ domains[application_id].users.anonymous.username }}
syncope_anonymous_password: {{ domains[application_id].credentials.anonymous.password }}
syncope_administrator_user: {{ domains[application_id].users.administrator.username }}
syncope_administrator_password: {{ domains[application_id].credentials.administrator.password }}

View File

@ -1,33 +0,0 @@
# Nginx Certbot Automation
## 🔥 Description
This role automates the setup of an automatic [Let's Encrypt](https://letsencrypt.org/) certificate renewal system for Nginx using [Certbot](https://certbot.eff.org/). It ensures that SSL/TLS certificates are renewed seamlessly in the background and that Nginx reloads automatically after successful renewals.
## 📖 Overview
Optimized for Archlinux systems, this role installs the `certbot-nginx` package, configures a dedicated `systemd` service for certificate renewal, and integrates with a `systemd-timer` to schedule periodic renewals. After a renewal, Nginx is reloaded to apply the updated certificates immediately.
### Key Features
- **Automatic Renewal:** Schedules unattended certificate renewals using systemd-timers.
- **Seamless Nginx Reload:** Reloads the Nginx service automatically after successful renewals.
- **Systemd Integration:** Manages renewal operations reliably with `systemd` and `systemd-notifier`.
- **Quiet and Safe Operation:** Uses `--quiet` and `--agree-tos` flags to ensure non-interactive renewals.
## 🎯 Purpose
The Nginx Certbot Automation role ensures that Let's Encrypt SSL/TLS certificates stay valid without manual intervention. It enhances the security and reliability of web services by automating certificate lifecycle management.
## 🚀 Features
- **Certbot-Nginx Package Installation:** Installs required certbot plugins for Nginx.
- **Custom Systemd Service:** Configures a lightweight, dedicated renewal service.
- **Timer Setup:** Uses systemd-timer to run certbot renewals periodically.
- **Failure Notification:** Integrated with `systemd-notifier` for alerting on failures.
## 🔗 Learn More
- [Certbot Official Website](https://certbot.eff.org/)
- [Let's Encrypt](https://letsencrypt.org/)
- [Systemd (Wikipedia)](https://en.wikipedia.org/wiki/Systemd)
- [HTTPS (Wikipedia)](https://en.wikipedia.org/wiki/HTTPS)

View File

@ -1,32 +1,3 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: |
Automates Let's Encrypt SSL/TLS certificate renewals for Nginx using Certbot and systemd services with automatic reloads after successful renewals.
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
- certbot
- ssl
- tls
- letsencrypt
- https
- systemd
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- certbot - nginx
- nginx - systemd-notifier
- systemd-notifier

View File

@ -1,7 +1,6 @@
- name: install certbot - name: install certbot
pacman: pacman:
name: name: [certbot,certbot-nginx]
- certbot-nginx
state: present state: present
when: run_once_nginx_certbot is not defined when: run_once_nginx_certbot is not defined

View File

@ -1,4 +1,4 @@
- name: "include role for {{domain}} to receive certificates and do the modification routines" - name: "include role for {{domain}} to recieve certificates and do the modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all

View File

@ -1,9 +1,8 @@
--- ---
- name: "Remove Nginx configuration for deprecated domains" - name: "Remove Nginx configuration for deprecated domains"
ansible.builtin.command: ansible.builtin.file:
cmd: >- path: "/etc/nginx/conf.d/http/servers/{{ item }}"
rm -fv /etc/nginx/conf.d/http/servers/*.{{ item }}.conf; state: absent
rm -fv /etc/nginx/conf.d/http/servers/{{ item }}.conf
loop: "{{ deprecated_domains }}" loop: "{{ deprecated_domains }}"
loop_control: loop_control:
label: "{{ item }}" label: "{{ item }}"
@ -12,7 +11,6 @@
- mode_cleanup | bool - mode_cleanup | bool
- run_once_nginx_domains_cleanup is not defined - run_once_nginx_domains_cleanup is not defined
# The revoking just works for the base domain
- name: "Revoke Certbot certificate for {{ item }}" - name: "Revoke Certbot certificate for {{ item }}"
ansible.builtin.command: ansible.builtin.command:
cmd: "certbot revoke -n --cert-name {{ item }}" cmd: "certbot revoke -n --cert-name {{ item }}"
@ -23,9 +21,7 @@
when: when:
- mode_cleanup | bool - mode_cleanup | bool
- run_once_nginx_domains_cleanup is not defined - run_once_nginx_domains_cleanup is not defined
ignore_errors: true
# The deleting just works for the base domain
- name: "Delete Certbot certificate for {{ item }}" - name: "Delete Certbot certificate for {{ item }}"
ansible.builtin.command: ansible.builtin.command:
cmd: "certbot delete -n --cert-name {{ item }}" cmd: "certbot delete -n --cert-name {{ item }}"
@ -36,7 +32,6 @@
when: when:
- mode_cleanup | bool - mode_cleanup | bool
- run_once_nginx_domains_cleanup is not defined - run_once_nginx_domains_cleanup is not defined
ignore_errors: true
- name: run the nginx_domains_cleanup role once - name: run the nginx_domains_cleanup role once
set_fact: set_fact:

View File

@ -1,35 +1,39 @@
# Nginx HTTPS Certificate Retrieval # Let's Encrypt Certificate Role
## 🔥 Description This Ansible role uses Certbot to obtain Let's Encrypt SSL/TLS certificates. It supports both dedicated and wildcard certificate requests based on domain conditions. It can also clean up (delete) dedicated certificates when cleanup mode is enabled.
This role automates the retrieval of [Let's Encrypt](https://letsencrypt.org/) SSL/TLS certificates using [Certbot](https://certbot.eff.org/) for domains served via Nginx. It supports both single-domain and wildcard certificates, and can use either the DNS or webroot ACME challenge methods. ## Features
## 📖 Overview - **Dedicated Certificate Request:**
Requests a certificate for a given domain using Certbot's `certonly` command with the webroot plugin.
Designed for Archlinux systems, this role handles issuing certificates per domain and optionally cleans up redundant certificates if wildcard certificates are used. It intelligently decides whether to issue a standard or wildcard certificate based on the domain structure and your configuration. - **Wildcard Certificate Request:**
When enabled, obtains a wildcard certificate for the primary domain (including both the primary domain and all its direct subdomains).
### Key Features - **Certificate Cleanup:**
- **Single Domain and Wildcard Support:** Handles both individual domains and wildcard domains (`*.example.com`). Provides an option to delete dedicated certificates if cleanup mode is active.
- **DNS and Webroot Challenges:** Dynamically selects the correct ACME challenge method.
- **Certificate Renewal Logic:** Skips renewal if the certificate is still valid.
- **Optional Cleanup:** Deletes redundant domain certificates when wildcard certificates are used.
- **Non-Interactive Operation:** Fully automated using `--non-interactive` and `--agree-tos`.
## 🎯 Purpose - **Run Once for Wildcard:**
Ensures that the wildcard certificate task runs only once to prevent duplicate requests.
The Nginx HTTPS Certificate Retrieval role ensures that your Nginx-served domains have valid, automatically issued SSL/TLS certificates, improving web security without manual intervention. ## Tasks Overview
## 🚀 Features - **Receive Dedicated Certificate:**
Executes Certbot to request a dedicated certificate for `{{ domain }}` when a wildcard certificate is not applicable.
- **ACME Challenge Selection:** Supports DNS plugins or webroot method automatically. - **Receive Wildcard Certificate:**
- **Wildcard Certificate Management:** Issues wildcard certificates when configured, saving effort for subdomain-heavy deployments. Executes Certbot to request a wildcard certificate for `*{{ primary_domain }}` under the appropriate conditions.
- **Safe Cleanup:** Ensures that no unused certificates are left behind.
- **Flexible Control:** Supports `mode_test` for staging environment testing and `mode_cleanup` for cert cleanup operations.
## 🔗 Learn More - **Cleanup Dedicated Certificate:**
Runs Certbot's delete command to remove the dedicated certificate if cleanup mode is active.
- [Certbot Official Website](https://certbot.eff.org/) - **Run Once Flag:**
- [Let's Encrypt](https://letsencrypt.org/) Sets a fact to ensure that the wildcard certificate task is executed only once per playbook run.
- [Wildcard Certificates (Wikipedia)](https://en.wikipedia.org/wiki/Wildcard_certificate)
- [HTTPS (Wikipedia)](https://en.wikipedia.org/wiki/HTTPS) ## Author
- [ACME Protocol (Wikipedia)](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment)
This role is authored by [Kevin Veen-Birkenbach](https://www.veen.world).
---
Feel free to contribute or open issues if you have suggestions or encounter any problems with the role. Enjoy secure connections with Let's Encrypt and Ansible!

View File

@ -1,31 +1,2 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: |
Automates the retrieval of Let's Encrypt SSL/TLS certificates for Nginx domains using Certbot, supporting both single-domain and wildcard certificates with DNS and webroot ACME challenges.
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
- certbot
- letsencrypt
- ssl
- tls
- acme
- https
- wildcard
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- nginx-https - nginx-https

View File

@ -1,21 +1,8 @@
- name: "receive dedicated certificate for {{ domain }}" - name: "recieve dedicated certificate for {{ domain }}"
command: >- command: >-
certbot certonly certbot certonly --agree-tos --email {{ users.administrator.email }}
--agree-tos --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ domain }}
--email {{ users.administrator.email }}
--non-interactive
{% if certbot_acme_challenge_method != "webroot" %}
--dns-{{ certbot_acme_challenge_method }}
--dns-{{ certbot_acme_challenge_method }}-credentials {{ certbot_credentials_file }}
--dns-{{ certbot_acme_challenge_method }}-propagation-seconds 60
{% else %}
--webroot
-w /var/lib/letsencrypt/
{% endif %}
-d {{ domain }}
{{ '--test-cert' if mode_test | bool else '' }} {{ '--test-cert' if mode_test | bool else '' }}
register: certbot_result
changed_when: "'Certificate not yet due for renewal' not in certbot_result.stdout"
when: when:
- not enable_wildcard_certificate | bool or not (domain.split('.') | length == (primary_domain.split('.') | length + 1) and domain.endswith(primary_domain)) - not enable_wildcard_certificate | bool or not (domain.split('.') | length == (primary_domain.split('.') | length + 1) and domain.endswith(primary_domain))
# Wildcard certificate should not be used # Wildcard certificate should not be used
@ -23,31 +10,17 @@
# The following should not work, checkout the Setup.md instructions. # The following should not work, checkout the Setup.md instructions.
# @see https://chatgpt.com/share/67efa9f0-1cdc-800f-8bce-62b00fc3e6a2 # @see https://chatgpt.com/share/67efa9f0-1cdc-800f-8bce-62b00fc3e6a2
- name: "receive wildcard certificate *{{ primary_domain }} for {{domain}}" - name: "recieve wildcard certificate *{{ primary_domain }} for {{domain}}"
command: >- command: >-
certbot certonly certbot certonly --agree-tos --email {{ users.administrator.email }}
--agree-tos --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ primary_domain }} -d *.{{ primary_domain }}
--email {{ users.administrator.email }}
--non-interactive
{% if certbot_acme_challenge_method != "webroot" %}
--dns-{{ certbot_acme_challenge_method }}
--dns-{{ certbot_acme_challenge_method }}-credentials {{ certbot_credentials_file }}
--dns-{{ certbot_acme_challenge_method }}-propagation-seconds 60
{% else %}
--webroot
-w /var/lib/letsencrypt/
{% endif %}
-d {{ primary_domain }}
-d *.{{ primary_domain }}
{{ '--test-cert' if mode_test | bool else '' }} {{ '--test-cert' if mode_test | bool else '' }}
register: certbot_result
changed_when: "'Certificate not yet due for renewal' not in certbot_result.stdout"
when: when:
- enable_wildcard_certificate | bool - enable_wildcard_certificate | bool
# Wildcard certificate is enabled # Wildcard certificate is enabled
- domain.split('.') | length == (primary_domain.split('.') | length + 1) and domain.endswith(primary_domain) - domain.split('.') | length == (primary_domain.split('.') | length + 1) and domain.endswith(primary_domain)
# AND: The domain is a direct first-level subdomain of the primary domain # AND: The domain is a direct first-level subdomain of the primary domain
- run_once_receive_certificate is not defined - run_once_recieve_certificate is not defined
# Ensure this task runs only once for the wildcard certificate # Ensure this task runs only once for the wildcard certificate
ignore_errors: true ignore_errors: true
@ -67,7 +40,7 @@
failed_when: certbot_result.rc != 0 and ("No certificate found with name" not in certbot_result.stderr) failed_when: certbot_result.rc != 0 and ("No certificate found with name" not in certbot_result.stderr)
changed_when: certbot_result.rc == 0 and ("No certificate found with name" not in certbot_result.stderr) changed_when: certbot_result.rc == 0 and ("No certificate found with name" not in certbot_result.stderr)
- name: run the receive_certificate tasks once - name: run the recieve_certificate tasks once
set_fact: set_fact:
run_once_receive_certificate: true run_once_recieve_certificate: true
when: run_once_receive_certificate is not defined when: run_once_recieve_certificate is not defined

View File

@ -1,35 +1,3 @@
# Nginx File Server # Nginx File Server
## 🔥 Description This Ansible role configures an Nginx server to serve files.
The Nginx File Server role sets up a simple and secure static file server using [Nginx](https://nginx.org/). It provides an easy way to serve files over HTTPS, including directory listing, `.well-known` support, and automatic SSL/TLS certificate integration via Let's Encrypt.
## 📖 Overview
Optimized for Archlinux, this role configures Nginx to act as a lightweight and efficient file server. It ensures that files are served securely, with optional directory browsing enabled, and proper MIME type handling for standard web clients.
### Key Features
- **HTTPS Secured File Hosting:** Automatically retrieves SSL/TLS certificates using Let's Encrypt.
- **Autoindex Directory Listing:** Displays files and folders in a clean and human-readable format.
- **.well-known Support:** Fully supports ACME and other `.well-known` path requirements.
- **Customizable File Path:** Easily adjust the root directory for your files through Ansible variables.
- **Local Time Display:** Enhances directory listings by showing local timestamps.
## 🎯 Purpose
The Nginx File Server role is ideal for hosting static files, sharing resources internally or externally, and serving ACME challenges for certificate issuance. It offers a reliable and minimalistic alternative to more complex file-sharing solutions.
## 🚀 Features
- **Automatic SSL/TLS Certificate Management:** Integrates with Let's Encrypt for secure access.
- **Simple Configuration:** Minimal setup with clear, maintainable templates.
- **Directory Listings:** Enables browsing through served files with human-readable file sizes and timestamps.
- **Static Content Hosting:** Serve any type of static files (documents, software, media, etc.).
- **Well-Known Folder Support:** Allows serving validation files and other standardized resources easily.
## 🔗 Learn More
- [Nginx Official Website](https://nginx.org/)
- [Let's Encrypt](https://letsencrypt.org/)
- [HTTP File Server (Wikipedia)](https://en.wikipedia.org/wiki/HTTP_File_Server)
- [HTTPS (Wikipedia)](https://en.wikipedia.org/wiki/HTTPS)

View File

@ -1,30 +1,3 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: |
Configures an Nginx-based file server with HTTPS support, automatic SSL/TLS certificate retrieval, directory listing, and .well-known handling for secure static file hosting.
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
- https
- file-server
- static-files
- ssl
- letsencrypt
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- nginx-https - nginx-https
- git - git

View File

@ -1,5 +1,5 @@
--- ---
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all
vars: vars:

View File

@ -1,38 +1,6 @@
# Nginx Static HTML Server # Nginx Homepage Role
## 🔥 Description This Ansible role configures an Nginx server to serve a static homepage. It handles domain configuration, SSL certificate retrieval with Let's Encrypt.
This role configures an [Nginx](https://nginx.org/) server to host a static HTML homepage securely over HTTPS. It automates domain configuration, SSL/TLS certificate retrieval using [Let's Encrypt](https://letsencrypt.org/), and ensures your site is ready for production with minimal setup. ## Author Information
This role was created in 2023 by [Kevin Veen Birkenbach](https://www.veen.world/).
## 📖 Overview
Optimized for Archlinux environments, this role provides a lightweight, reliable solution for serving static websites. It automatically configures Nginx to serve files from a predefined directory, sets up secure HTTPS connections, and includes support for `.well-known` paths required by ACME challenges.
### Key Features
- **Static Site Hosting:** Serves HTML, CSS, JavaScript, and other static files.
- **Let's Encrypt Integration:** Automatically requests and installs SSL/TLS certificates.
- **Simple Root Configuration:** Defines a clean webroot with `index.html` support.
- **Secure by Default:** Includes modern SSL headers and best practices via Nginx.
- **.well-known Support:** Ensures full ACME challenge compatibility.
## 🎯 Purpose
The Nginx Static HTML Server role provides a simple and efficient method to publish static websites with HTTPS, perfect for personal homepages, landing pages, or small projects.
## 🚀 Features
- **Automatic HTTPS Certificates:** Handles secure certificate issuance via Let's Encrypt.
- **Minimal Nginx Setup:** Clean and optimized default configurations.
- **Highly Portable:** Works out-of-the-box with minimal variables.
- **Local Time Support:** Properly displays directory listing timestamps when needed.
## 🔗 Learn More
- [Nginx Official Website](https://nginx.org/)
- [Let's Encrypt](https://letsencrypt.org/)
- [Static Web Page (Wikipedia)](https://en.wikipedia.org/wiki/Static_web_page)
- [HTTPS (Wikipedia)](https://en.wikipedia.org/wiki/HTTPS)
## 🧑‍💻 Author Information
Created in 2023 by [Kevin Veen-Birkenbach](https://www.veen.world/)

View File

@ -1,31 +1,3 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: |
Configures an Nginx server to host static HTML websites with HTTPS support, automatic SSL certificate retrieval via Let's Encrypt, and secure default settings.
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
- https
- static
- html
- letsencrypt
- ssl
- homepage
- automation
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- nginx-https - nginx-https
- git - git

View File

@ -1,5 +1,5 @@
--- ---
- name: "include role for {{application_id}} to receive certs & do modification routines" - name: "include role for {{application_id}} to recieve certs & do modification routines"
include_role: include_role:
name: nginx-https-get-cert-modify-all name: nginx-https-get-cert-modify-all
vars: vars:

View File

@ -1,16 +1,17 @@
- name: update pkgmgr - name: "pkgmgr installation tasks"
shell: | become: "{{ pkgmgr_become }}"
source ~/.venvs/pkgmgr/bin/activate block:
pkgmgr update pkgmgr - name: update pkgmgr
command:
cmd: "pkgmgr update pkgmgr"
when: run_once_pkgmgr_update is not defined when: run_once_pkgmgr_update is not defined
- name: update {{ package_name }} - name: update {{ package_name }}
shell: | command:
source ~/.venvs/pkgmgr/bin/activate cmd: "pkgmgr update {{ package_name }} --dependencies --clone-mode https"
pkgmgr update {{ package_name }} --dependencies --clone-mode https
notify: "{{ package_notify | default(omit) }}" notify: "{{ package_notify | default(omit) }}"
- name: mark pkgmgr update as done - name: mark pkgmgr update as done
set_fact: set_fact:
run_once_pkgmgr_update: true run_once_pkgmgr_update: true
when: run_once_pkgmgr_update is not defined when: run_once_pkgmgr_update is not defined

View File

@ -38,12 +38,9 @@
when: run_once_package_manager is not defined when: run_once_package_manager is not defined
- name: Run the Package Manager install command to create an alias for Kevins package manager - name: Run the Package Manager install command to create an alias for Kevins package manager
shell: | command: "make setup"
source ~/.venvs/pkgmgr/bin/activate
make setup
args: args:
chdir: "{{ pkgmgr_install_path }}" chdir: "{{ pkgmgr_install_path }}"
executable: /bin/bash
become: yes become: yes
when: run_once_package_manager is not defined when: run_once_package_manager is not defined

View File

@ -797,20 +797,6 @@ defaults_applications:
'iframe': false, 'iframe': false,
}) }}{% raw %} }) }}{% raw %}
# syncope:
# version: "latest"
# credentials:
# anonymous:
# password: # Set in environment file
# database:
# password: # Set in environment file
# administrator:
# password: "{{ users.administrator.password }}"
# users:
# administrator:
# username: "{{ users.administrator.username }}"
## Taiga ## Taiga
taiga: taiga:
version: "latest" version: "latest"