Compare commits

..

13 Commits

Author SHA1 Message Date
uumas
f989c204d1 service: fix conditional 2025-10-06 16:13:35 +03:00
uumas
69eca0189e authentik: update image 2025-10-06 16:12:53 +03:00
uumas
33791031e2 prometheus: Update config option name 2025-09-14 03:11:23 +03:00
uumas
e0047b73f4 jitsi: Use firewalld 2025-09-14 03:11:11 +03:00
uumas
8fdb8eaf80 authentik: Support for additional mounts 2025-05-26 00:00:27 +03:00
uumas
bc2220e1ed service: fix published ports 2025-05-25 23:59:57 +03:00
uumas
4d4ade6ae2 Fix docker_published_ports not working when set to db_published_ports 2025-04-24 00:53:39 +03:00
uumas
3e9d83457d docker: use deb822 repo 2025-04-04 19:22:20 +03:00
uumas
5b4bea1b09 service: set reasonable defaults for copypath modes 2025-03-27 22:20:07 +02:00
uumas
53af0b80f6 gitea: update config option name 2025-03-27 22:19:48 +02:00
uumas
8f777f7ed7 dokuwiki: use official image instead of bitnami 2025-03-27 22:19:23 +02:00
uumas
f2bd55941a container -> service migration 2025-03-27 22:19:03 +02:00
uumas
2fef2c6ad8 fix some roles 2025-02-15 11:43:16 +02:00
21 changed files with 92 additions and 55 deletions

View File

@@ -1,8 +1,7 @@
---
- name: Prometheus alertmanager container
include_role:
name: container
name: service
vars:
docker_service: alertmanager
docker_image: prom/alertmanager

View File

@@ -3,3 +3,5 @@ authentik_tag: latest
authentik_env: {}
docker_networks:
- name: authentik
authentik_additional_mounts: []

View File

@@ -15,6 +15,42 @@ argument_specs:
type: dict
required: false
default: {}
authentik_additional_mounts:
description: "List of bind mounts or volumes to be mounted inside the container. Each element is a dict with path and exactly one of name, src or template"
type: list
required: false
default: []
elements: dict
options:
path:
description: "The path inside the container to mount at"
type: str
required: true
readonly:
description: "If true, volume will be mounted as read only inside the container. Only applies for named and src mounts."
type: bool
required: false
default: false
mode:
description: "Permissions for the created/templated directory. Defaults to '0644' for files, '0755' for directories. Doesn't apply for named volumes."
type: str
required: false
name:
description: "If docker_volume_type is named, the name of the named volume to be mounted at path. If docker_volume_type is bind, the name of the folder to create under /opt/<service>[/suffix]/mounts/ and mount at path."
type: str
required: false
src:
description: "Host path to bind mount inside the container."
type: str
required: false
template:
description: "Name of template without .j2 extension. Will be templated at /opt/<service>[/suffix]/mounts/<template> and mounted read only inside the container."
type: str
required: false
copypath:
description: "Name of file or directory to copy. Will be deployed from files/<copypath> to /opt/<service>[/suffix]/mounts/<copypath> and mounted read only inside the container."
type: str
required: false
# All options after this will be passed directly to the container role
docker_service_suffix:

View File

@@ -4,7 +4,7 @@
name: service
vars:
docker_service: authentik
docker_image: "beryju/authentik:{{ authentik_tag }}"
docker_image: "ghcr.io/goauthentik/server:{{ authentik_tag }}"
docker_command:
- server
docker_image_http_port: 9000
@@ -12,13 +12,7 @@
docker_additional_services:
- redis
docker_env: "{{ authentik_common_env | combine(authentik_env) }}"
docker_mounts:
- path: /media
name: "media"
- path: /templates
name: "templates"
- path: /certs
name: "certs"
docker_mounts: "{{ _authentik_mounts }}"
- name: Authentik worker container
ansible.builtin.include_role:
@@ -26,15 +20,9 @@
vars:
docker_namespace: authentik
docker_service: worker
docker_image: "beryju/authentik:{{ authentik_tag }}"
docker_image: "ghcr.io/goauthentik/server:{{ authentik_tag }}"
docker_command:
- worker
reverse_proxy_type: none
docker_env: "{{ authentik_common_env | combine(authentik_env) }}"
docker_mounts:
- path: /media
name: "media"
- path: /templates
name: "templates"
- path: /certs
name: "certs"
docker_mounts: "{{ _authentik_mounts }}"

View File

@@ -1,4 +1,12 @@
---
_authentik_default_mounts:
- path: /media
name: "media"
- path: /templates
name: "templates"
- path: /certs
name: "certs"
_authentik_mounts: "{{ _authentik_default_mounts + authentik_additional_mounts }}"
authentik_common_env:
AUTHENTIK_REDIS__HOST: authentik-redis

View File

@@ -4,7 +4,7 @@
name: service
vars:
docker_service: authentik-ldap
docker_image: beryju/authentik-ldap:{{ authentik_ldap_tag }}
docker_image: ghcr.io/goauthentik/ldap:{{ authentik_ldap_tag }}
reverse_proxy_type: none
docker_env:
AUTHENTIK_HOST: "{{ authentik_ldap_authentik_address }}"

View File

@@ -1,14 +1,17 @@
---
- name: Ensure legacy apt repository not present
ansible.builtin.file:
path: /etc/apt/sources.list.d/docker.list
state: absent
- name: Add docker apt repository
ansible.builtin.import_role:
name: uumas.general.apt_repository
vars:
repo_name: docker
repo_url: https://download.docker.com/linux/{{ ansible_distribution | lower }}
repo_key_url: https://download.docker.com/linux/debian/gpg
repo_arch: "{{ apt_arch }}"
repo_components:
ansible.builtin.deb822_repository:
name: docker
uris: https://download.docker.com/linux/{{ ansible_distribution | lower }}
signed_by: https://download.docker.com/linux/debian/gpg
suites: "{{ ansible_distribution_release }}"
# architectures: "{{ apt_arch }}"
components:
- stable
- name: Install docker

View File

@@ -1,4 +1,3 @@
---
dokuwiki_wiki_name: DokuWiki
dokuwiki_admin_email: "{{ admin_email }}"

View File

@@ -1,18 +1,11 @@
---
- name: Dokuwiki container
import_role:
name: container
name: service
vars:
docker_service: dokuwiki
docker_image: bitnami/dokuwiki
docker_image: dokuwiki/dokuwiki:stable
docker_image_http_port: 8080
docker_mounts:
- name: data
path: /bitnami/dokuwiki
docker_env:
DOKUWIKI_USERNAME: admin
DOKUWIKI_FULL_NAME: Admin
DOKUWIKI_PASSWORD: "{{ dokuwiki_admin_password }}"
DOKUWIKI_EMAIL: "{{ dokuwiki_admin_email }}"
DOKUWIKI_WIKI_NAME: "{{ dokuwiki_wiki_name }}"
path: /storage

View File

@@ -26,7 +26,7 @@ dependencies:
GITEA__mailer__ENABLED: "true"
GITEA__mailer__HOST: "{{ smtp_server }}:587"
GITEA__mailer__FROM: "{{ smtp_from }}"
GITEA__mailer__MAILER_TYPE: smtp
GITEA__mailer__PROTOCOL: smtp
GITEA__mailer__USER: "{{ smtp_user | default(omit) }}"
GITEA__mailer__PASSWD: "{{ smtp_pw | default(omit) }}"
GITEA__service__REQUIRE_SIGNIN_VIEW: "{{ gitea_require_signin_view | default(omit) }}"

View File

@@ -1,8 +1,7 @@
---
- name: Grafana container
import_role:
name: container
include_role:
name: service
vars:
docker_service: grafana
docker_image: grafana/grafana

View File

@@ -7,7 +7,7 @@ dependencies:
docker_image_http_port: 3000
docker_database: postgres
docker_mounts:
- name: hedgedoc_uploads
- name: uploads
path: /hedgedoc/public/uploads
docker_env:
CMD_DB_URL: postgres://hedgedoc:{{ database_passwords.hedgedoc }}@hedgedoc_db:5432/hedgedoc

View File

@@ -133,3 +133,13 @@
- name: meet.jitsi
aliases:
- jvb.meet.jitsi
- name: Open ports for jitsi
ansible.posix.firewalld:
port: "{{ item }}"
state: enabled
permanent: true
immediate: true
loop:
- 4443/tcp
- 10000/udp

View File

@@ -6,13 +6,12 @@ dependencies:
docker_image: quay.io/keycloak/keycloak:latest
docker_image_http_port: 8080
docker_database: postgres
docker_command: start
docker_command: start --proxy-headers xforwarded
docker_env:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: "{{ keycloak_admin_pw }}"
KC_HOSTNAME: "{{ docker_vhost_domains.keycloak[0] }}"
KC_HTTP_ENABLED: "true"
KC_PROXY: edge
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak_db/keycloak
KC_DB_USERNAME: keycloak

View File

@@ -1,8 +1,7 @@
---
- name: Prometheus container
include_role:
name: container
name: service
vars:
docker_service: prometheus
docker_image: prom/prometheus
@@ -10,7 +9,7 @@
docker_command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention={{ prometheus_storage_retention }}"
- "--storage.tsdb.retention.time={{ prometheus_storage_retention }}"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
docker_mounts:
@@ -33,7 +32,7 @@
- name: Webhook container for prometheus
include_role:
name: container
name: service
vars:
docker_service: prometheus_webhook
docker_image: thecatlady/webhook
@@ -47,7 +46,7 @@
- name: Blackbox exporter for prometheus
include_role:
name: container
name: service
vars:
docker_service: blackbox_exporter
docker_image: prom/blackbox-exporter

View File

@@ -68,4 +68,4 @@
image_user: "{{ container_image.Config.User }}"
when:
- not ansible_check_mode
- container_image.Config.User | int
- container_image.Config.User | int != 0

View File

@@ -10,6 +10,7 @@
_docker_service_name: "{{ docker_service_name }}"
_docker_mount_definition: "{{ docker_mount_definition }}"
_container_published_ports: "{{ container_published_ports }}"
_docker_published_ports: "{{ docker_published_ports }}"
_container_image: "{{ container_image }}"
_container_networks: "{{ container_networks }}"
_template_mounts_needed: "{{ template_mounts_needed }}"

View File

@@ -1,6 +1,6 @@
---
- name: Container role initialization
- name: Role initialization
import_tasks: init.yml
- name: Docker network
@@ -123,6 +123,7 @@
docker_service_name: "{{ _docker_service_name }}"
docker_mount_definition: "{{ _docker_mount_definition }}"
container_published_ports: "{{ _container_published_ports }}"
docker_published_ports: "{{ _docker_published_ports }}"
container_image: "{{ _container_image }}"
container_networks: "{{ _container_networks }}"
template_mounts_needed: "{{ _template_mounts_needed }}"

View File

@@ -41,7 +41,8 @@
copy:
src: "files/{{ item.copypath }}"
dest: "{{ docker_mounts_dir }}/"
mode: "{{ item.mode | default('0755') }}"
directory_mode: "{{ item.mode | default('0755') }}"
mode: "{{ item.mode | default('0644') }}"
when: item.copypath is defined
loop: "{{ docker_mounts }}"
notify: Restart container

View File

@@ -7,7 +7,7 @@ dependencies:
docker_image_http_port: 8080
docker_database: mongo
docker_mounts:
- name: wekan_data
- name: data
path: /data
docker_env:
MONGO_URL: mongodb://wekan_db:27017/wekan

View File

@@ -1,5 +1,4 @@
---
- name: Get wekan data volume path from container creation output
set_fact:
wekan_data_volume: "{{ container_out.container.Mounts | selectattr('Destination', 'equalto', '/data') | join }}"