Optimized locales and networks variable

This commit is contained in:
Kevin Veen-Birkenbach 2025-02-03 14:56:12 +01:00
parent 30ccd30fa6
commit 83c84f6e86
14 changed files with 59 additions and 62 deletions

View File

@ -1,7 +1,9 @@
# General # General
pause_duration: "120" # Database delay to wait for the central database before continue tasks pause_duration: "120" # Database delay to wait for the central database before continue tasks
ip4_address: "127.0.0.1" # Change thie in inventory to the ip address of your server
backups_folder_path: "/Backups/" # Path to the backups folder backups_folder_path: "/Backups/" # Path to the backups folder
timezone: "UTC"
locale: "locale"
## Domain ## Domain
primary_domain_tld: "localhost" # Top Level Domain of the server primary_domain_tld: "localhost" # Top Level Domain of the server

View File

@ -172,6 +172,10 @@ defaults_applications:
postgres: postgres:
database.version: "latest" database.version: "latest"
# Snipe-IT
snipe-it:
version: "latest"
## Taiga ## Taiga
taiga: taiga:
version: "latest" version: "latest"

View File

@ -44,6 +44,7 @@ ports:
keycloak: 8032 keycloak: 8032
ldap: 8033 ldap: 8033
phpmyadmin: 8034 phpmyadmin: 8034
snipe-it: 8035
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

@ -0,0 +1,9 @@
defaults_networks:
internet:
ip4: "127.0.0.1" # Change this in inventory to the ip address of your server
ip6: "::01" # Change this in inventory to the ip address of your server
local:
mailu:
dns: 192.168.203.254 # Address of the Mailu DNS server

View File

@ -11,6 +11,9 @@
- name: Merge application definitions - name: Merge application definitions
set_fact: set_fact:
applications: "{{ defaults_applications | combine(applications | default({}, true), recursive=True) }}" applications: "{{ defaults_applications | combine(applications | default({}, true), recursive=True) }}"
- name: Merge networks definitions
set_fact:
networks: "{{ defaults_networks | combine(networks | default({}, true), recursive=True) }}"
- name: update device - name: update device
hosts: all hosts: all

View File

@ -1,6 +1,6 @@
# You should change this to match your reverse proxy DNS name and protocol # You should change this to match your reverse proxy DNS name and protocol
APP_URL=https://{{domain}} APP_URL=https://{{domain}}
LOCALE=en-US LOCALE={{locale}}
# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost) # Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
DB_HOST={{database_host}} DB_HOST={{database_host}}

View File

@ -41,12 +41,12 @@ FSESL_PASSWORD={{bigbluebutton_fsesl_password}}
DOMAIN={{domain}} DOMAIN={{domain}}
EXTERNAL_IPv4={{ip4_address}} EXTERNAL_IPv4={{{{networks.internet.ip4}}}}
EXTERNAL_IPv6= EXTERNAL_IPv6=
# STUN SERVER # STUN SERVER
# stun.freeswitch.org # stun.freeswitch.org
STUN_IP={{ip4_address}} STUN_IP={{{{networks.internet.ip4}}}}
STUN_PORT=3478 STUN_PORT=3478
# TURN SERVER # TURN SERVER

View File

@ -34,7 +34,7 @@ env:
LC_ALL: en_US.UTF-8 LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8 LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8 LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en #DISCOURSE_DEFAULT_LOCALE: {{locale}} # Deactivated because not right format was selected @todo find right format
## How many concurrent web requests are supported? Depends on memory and CPU cores. ## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override ## will be set automatically by bootstrap based on detected CPUs, or you can override

View File

@ -57,28 +57,6 @@ The role performs the following main tasks:
3. **Start Docker containers:** 3. **Start Docker containers:**
- The role launches the Keycloak project using Docker Compose. - The role launches the Keycloak project using Docker Compose.
## Example: Usage 🚀
Here is an example of how to use this role in a playbook:
```yaml
- name: Setup Keycloak with Docker
hosts: all
vars:
domain: "auth.example.com"
applications.keycloak.version: "21.1.0"
applications.keycloak.administrator_username: "admin"
keycloak_administrator_password: "securepassword"
database_host: "db.example.com"
database_name: "keycloak_db"
database_username: "keycloak_user"
database_password: "securedbpassword"
http_port: 8080
docker_restart_policy: "unless-stopped"
roles:
- docker-keycloak
```
## More Information 📚 ## More Information 📚
For more details about Keycloak, check out: For more details about Keycloak, check out:

View File

@ -29,10 +29,10 @@
dest: "{{docker_compose_instance_directory}}docker-compose.yml" dest: "{{docker_compose_instance_directory}}docker-compose.yml"
notify: docker compose project setup notify: docker compose project setup
- name: add mailu.env - name: add .env
template: template:
src: "mailu.env.j2" src: ".env.j2"
dest: "{{docker_compose_instance_directory}}mailu.env" dest: "{{docker_compose_instance_directory}}.env"
notify: docker compose project setup notify: docker compose project setup
- name: flush docker service - name: flush docker service

View File

@ -7,29 +7,29 @@ services:
# Core services # Core services
resolver: resolver:
image: ghcr.io/mailu/unbound:{{applications.mailu.version}} image: ghcr.io/mailu/unbound:{{applications.mailu.version}}
env_file: mailu.env env_file: .env
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
ipv4_address: 192.168.203.254 ipv4_address: {{networks.local.mailu.dns}}
logging: logging:
driver: journald driver: journald
front: front:
image: ghcr.io/mailu/nginx:{{applications.mailu.version}} image: ghcr.io/mailu/nginx:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
logging: logging:
driver: journald driver: journald
ports: ports:
- "127.0.0.1:{{ http_port }}:80" - "127.0.0.1:{{ http_port }}:80"
- "{{ ip4_address }}:25:25" - "{{networks.internet.ip4}}:25:25"
- "{{ ip4_address }}:465:465" - "{{networks.internet.ip4}}:465:465"
- "{{ ip4_address }}:587:587" - "{{networks.internet.ip4}}:587:587"
- "{{ ip4_address }}:110:110" - "{{networks.internet.ip4}}:110:110"
- "{{ ip4_address }}:995:995" - "{{networks.internet.ip4}}:995:995"
- "{{ ip4_address }}:143:143" - "{{networks.internet.ip4}}:143:143"
- "{{ ip4_address }}:993:993" - "{{networks.internet.ip4}}:993:993"
- "{{ ip4_address }}:4190:4190" - "{{networks.internet.ip4}}:4190:4190"
volumes: volumes:
- "/etc/mailu/overrides/nginx:/overrides:ro" - "/etc/mailu/overrides/nginx:/overrides:ro"
- "{{cert_mount_directory}}:/certs:ro" - "{{cert_mount_directory}}:/certs:ro"
@ -40,12 +40,12 @@ services:
webmail: webmail:
radicale: radicale:
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
admin: admin:
image: ghcr.io/mailu/admin:{{applications.mailu.version}} image: ghcr.io/mailu/admin:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "admin_data:/data" - "admin_data:/data"
- "dkim:/dkim" - "dkim:/dkim"
@ -57,13 +57,13 @@ services:
logging: logging:
driver: journald driver: journald
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
imap: imap:
image: ghcr.io/mailu/dovecot:{{applications.mailu.version}} image: ghcr.io/mailu/dovecot:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "dovecot_mail:/mail" - "dovecot_mail:/mail"
- "/etc/mailu/overrides:/overrides:ro" - "/etc/mailu/overrides:/overrides:ro"
@ -71,7 +71,7 @@ services:
- front - front
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
logging: logging:
driver: journald driver: journald
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
@ -79,7 +79,7 @@ services:
smtp: smtp:
image: ghcr.io/mailu/postfix:{{applications.mailu.version}} image: ghcr.io/mailu/postfix:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "/etc/mailu/overrides:/overrides:ro" - "/etc/mailu/overrides:/overrides:ro"
- "smtp_queue:/queue" - "smtp_queue:/queue"
@ -87,7 +87,7 @@ services:
- front - front
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
logging: logging:
driver: journald driver: journald
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
@ -99,14 +99,14 @@ services:
depends_on: depends_on:
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
noinet: noinet:
antispam: antispam:
image: ghcr.io/mailu/rspamd:{{applications.mailu.version}} image: ghcr.io/mailu/rspamd:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "filter:/var/lib/rspamd" - "filter:/var/lib/rspamd"
- "dkim:/dkim" - "dkim:/dkim"
@ -117,7 +117,7 @@ services:
- antivirus - antivirus
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
logging: logging:
driver: journald driver: journald
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
@ -128,13 +128,13 @@ services:
antivirus: antivirus:
image: clamav/clamav-debian:latest image: clamav/clamav-debian:latest
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "filter:/data" - "filter:/data"
depends_on: depends_on:
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
logging: logging:
driver: journald driver: journald
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
@ -142,7 +142,7 @@ services:
webdav: webdav:
image: ghcr.io/mailu/radicale:{{applications.mailu.version}} image: ghcr.io/mailu/radicale:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "webdav_data:/data" - "webdav_data:/data"
logging: logging:
@ -150,7 +150,7 @@ services:
depends_on: depends_on:
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
radicale: radicale:
@ -159,7 +159,7 @@ services:
volumes: volumes:
- "admin_data:/data" - "admin_data:/data"
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
logging: logging:
driver: journald driver: journald
depends_on: depends_on:
@ -168,13 +168,13 @@ services:
- imap - imap
- resolver - resolver
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
webmail: webmail:
image: ghcr.io/mailu/webmail:{{applications.mailu.version}} image: ghcr.io/mailu/webmail:{{applications.mailu.version}}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
env_file: mailu.env env_file: .env
volumes: volumes:
- "webmail_data:/data" - "webmail_data:/data"
- "/etc/mailu/overrides:/overrides:ro" - "/etc/mailu/overrides:/overrides:ro"
@ -185,7 +185,7 @@ services:
logging: logging:
driver: journald driver: journald
dns: dns:
- 192.168.203.254 - {{networks.local.mailu.dns}}
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
webmail: webmail:

View File

@ -1,7 +1,7 @@
matrix_servers: matrix_servers:
hosts: hosts:
{{inventory_hostname}}: {{inventory_hostname}}:
ansible_host: "{{ip4_address}}" ansible_host: "{{{{networks.internet.ip4}}}}"
ansible_ssh_user: administrator ansible_ssh_user: administrator
become: true become: true
become_user: root become_user: root

View File

@ -15,8 +15,8 @@ ENFORCE_EMAIL_VERIFICATION=false
PF_MAX_USERS=1000 PF_MAX_USERS=1000
OAUTH_ENABLED=true OAUTH_ENABLED=true
APP_TIMEZONE=UTC APP_TIMEZONE={{timezone}}
APP_LOCALE=en APP_LOCALE={{locale}}
## Pixelfed Tweaks ## Pixelfed Tweaks
LIMIT_ACCOUNT_SIZE=true LIMIT_ACCOUNT_SIZE=true