Compare commits

...

27 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
uumas
599332b1d9 Merge branch 'master' of git.uumas.fi:uumas/ansible-docker 2024-11-13 04:45:19 +02:00
uumas
ff77e75d1d service: only use user as owner if docker_host_user is true 2024-11-13 04:26:51 +02:00
uumas
006a87f678 service: Initialize db_published_ports 2024-11-13 04:25:58 +02:00
uumas
ae7558a470 service: Add default for docker_vhost_additional_locations 2024-11-13 03:22:09 +02:00
uumas
340d870049 Merge branch 'master' of git.uumas.fi:uumas/ansible-docker 2024-11-09 13:49:59 +02:00
uumas
abcaf22958 service: Add docker_vhost_additional_locations 2024-10-17 17:18:13 +03:00
uumas
fd75af01af Delete uisp 2024-10-16 14:54:02 +03:00
uumas
d6c316f7f2 that hasn't been needed for a while 2024-09-29 23:27:06 +03:00
uumas
88abb5b243 Add authentik ldap outpost role 2024-09-28 16:23:06 +03:00
uumas
ec58a89dff service: Make postgres version configurable 2024-09-28 15:54:05 +03:00
uumas
5692cadea5 authentik: Make tag configurable 2024-09-28 03:31:45 +03:00
uumas
2cef674456 element, jitsi: fix vhost_proxy_target 2024-08-02 05:45:02 +03:00
uumas
fbbcb365ba gitea: fix volume name 2024-07-28 17:44:16 +03:00
uumas
75d9a054f1 container/service: update http port 2024-07-28 17:43:51 +03:00
39 changed files with 175 additions and 101 deletions

View File

@@ -3,11 +3,11 @@
namespace: uumas namespace: uumas
name: docker name: docker
description: Roles for installing services in docker containers description: Roles for installing services in docker containers
version: 0.9.0 version: 0.9.1
readme: README.md readme: README.md
repository: https://git.uumas.fi/uumas/ansible-docker repository: https://git.uumas.fi/uumas/ansible-docker
license_file: LICENSE license_file: LICENSE
dependencies: dependencies:
uumas.general: '>=0.5.9' uumas.general: '>=0.5.13'
authors: authors:
- uumas - uumas

View File

@@ -74,6 +74,9 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false

View File

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

View File

@@ -33,6 +33,9 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false

View File

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

View File

@@ -5,11 +5,52 @@ argument_specs:
short_description: Authentik container short_description: Authentik container
description: "Sets up an authentik docker container." description: "Sets up an authentik docker container."
options: options:
authentik_tag:
description: 'Authentik version to use. Can be minor (2024.8) or patch (2024.8.1) or "latest".'
type: str
required: false
default: latest
authentik_env: authentik_env:
description: "dict of custom environment variables for authentik container" description: "dict of custom environment variables for authentik container"
type: dict type: dict
required: false required: false
default: {} 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 # All options after this will be passed directly to the container role
docker_service_suffix: docker_service_suffix:
@@ -38,6 +79,9 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false

View File

@@ -1,15 +1,10 @@
--- ---
- name: Set docker service full name (required because docker_mounts uses it)
set_fact:
authentik_service_name: "authentik{{ '_' + docker_service_suffix if docker_service_suffix is defined else '' }}"
- name: Authentik container - name: Authentik container
ansible.builtin.include_role: ansible.builtin.include_role:
name: service name: service
vars: vars:
docker_service: authentik docker_service: authentik
docker_image: beryju/authentik:latest docker_image: "ghcr.io/goauthentik/server:{{ authentik_tag }}"
docker_command: docker_command:
- server - server
docker_image_http_port: 9000 docker_image_http_port: 9000
@@ -17,13 +12,7 @@
docker_additional_services: docker_additional_services:
- redis - redis
docker_env: "{{ authentik_common_env | combine(authentik_env) }}" docker_env: "{{ authentik_common_env | combine(authentik_env) }}"
docker_mounts: docker_mounts: "{{ _authentik_mounts }}"
- path: /media
name: "media"
- path: /templates
name: "templates"
- path: /certs
name: "certs"
- name: Authentik worker container - name: Authentik worker container
ansible.builtin.include_role: ansible.builtin.include_role:
@@ -31,15 +20,9 @@
vars: vars:
docker_namespace: authentik docker_namespace: authentik
docker_service: worker docker_service: worker
docker_image: beryju/authentik:latest docker_image: "ghcr.io/goauthentik/server:{{ authentik_tag }}"
docker_command: docker_command:
- worker - worker
reverse_proxy_type: none reverse_proxy_type: none
docker_env: "{{ authentik_common_env | combine(authentik_env) }}" docker_env: "{{ authentik_common_env | combine(authentik_env) }}"
docker_mounts: docker_mounts: "{{ _authentik_mounts }}"
- path: /media
name: "media"
- path: /templates
name: "templates"
- path: /certs
name: "certs"

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_common_env:
AUTHENTIK_REDIS__HOST: authentik-redis AUTHENTIK_REDIS__HOST: authentik-redis

View File

@@ -0,0 +1 @@
Sets up an authentik ldap outpost container.

View File

@@ -0,0 +1,2 @@
---
authentik_ldap_tag: latest

View File

@@ -1,12 +1,21 @@
--- ---
argument_specs: argument_specs:
main: main:
short_description: UISP container short_description: Authentik container
description: "Sets up an UISP docker container." description: "Sets up an authentik docker container."
options: options:
ports: authentik_ldap_tag:
description: "ports.netflow is used directly. Others passed to container role" description: 'Authentik ldap outpost version to use. Can be minor (2024.8) or patch (2024.8.1) or "latest". Should probably be the same as authentik.'
type: str
required: false
default: latest
authentik_ldap_authentik_address:
description: "Address starting with https where authentik is reachable"
type: str
required: true
authentik_ldap_outpost_token:
description: Outpost token generated by authentik
type: str
required: true required: true
# All options after this will be passed directly to the container role # All options after this will be passed directly to the container role
@@ -17,6 +26,9 @@ argument_specs:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
database_passwords:
description: "Passed to container role"
required: false
docker_additional_services: docker_additional_services:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
@@ -24,12 +36,12 @@ argument_specs:
docker_volume_type: docker_volume_type:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
reverse_proxy_type: ports:
description: "Passed to container role"
required: false
docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
dockerfile:
description: "Passed to container role"
required: false

View File

@@ -0,0 +1,12 @@
---
- name: Authentik ldap container
ansible.builtin.include_role:
name: service
vars:
docker_service: authentik-ldap
docker_image: ghcr.io/goauthentik/ldap:{{ authentik_ldap_tag }}
reverse_proxy_type: none
docker_env:
AUTHENTIK_HOST: "{{ authentik_ldap_authentik_address }}"
AUTHENTIK_INSECURE: 'false'
AUTHENTIK_TOKEN: "{{ authentik_ldap_outpost_token }}"

View File

@@ -1,5 +1,4 @@
--- ---
- name: Reverse proxy - name: Reverse proxy
include_role: include_role:
name: uumas.general.vhost name: uumas.general.vhost
@@ -8,7 +7,7 @@
vhost_id: "{{ docker_service_name }}" vhost_id: "{{ docker_service_name }}"
vhost_proxy_target_protocol: "{{ docker_proxy_target_protocol }}" vhost_proxy_target_protocol: "{{ docker_proxy_target_protocol }}"
vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}" vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}"
vhost_proxy_target_port: "{{ ports[docker_service_name][proxy_target_protocol] }}" vhost_proxy_target_port: "{{ ports[docker_service_name][vhost_proxy_target_protocol] }}"
when: reverse_proxy_type != 'traefik' when: reverse_proxy_type != 'traefik'
- name: Set published ports variable to http port - name: Set published ports variable to http port

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 - name: Add docker apt repository
ansible.builtin.import_role: ansible.builtin.deb822_repository:
name: uumas.general.apt_repository name: docker
vars: uris: https://download.docker.com/linux/{{ ansible_distribution | lower }}
repo_name: docker signed_by: https://download.docker.com/linux/debian/gpg
repo_url: https://download.docker.com/linux/{{ ansible_distribution | lower }} suites: "{{ ansible_distribution_release }}"
repo_key_url: https://download.docker.com/linux/debian/gpg # architectures: "{{ apt_arch }}"
repo_arch: "{{ apt_arch }}" components:
repo_components:
- stable - stable
- name: Install docker - name: Install docker

View File

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

View File

@@ -40,6 +40,9 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false

View File

@@ -1,18 +1,11 @@
--- ---
- name: Dokuwiki container - name: Dokuwiki container
import_role: import_role:
name: container name: service
vars: vars:
docker_service: dokuwiki docker_service: dokuwiki
docker_image: bitnami/dokuwiki docker_image: dokuwiki/dokuwiki:stable
docker_image_http_port: 8080 docker_image_http_port: 8080
docker_mounts: docker_mounts:
- name: data - name: data
path: /bitnami/dokuwiki path: /storage
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 }}"

View File

@@ -6,5 +6,5 @@ dependencies:
vhost_type: reverse_proxy vhost_type: reverse_proxy
vhost_id: element vhost_id: element
vhost_domains: "{{ element_domains }}" vhost_domains: "{{ element_domains }}"
vhost_proxy_target: http://127.0.0.1:{{ ports.element_http }} vhost_proxy_target_port: "{{ ports.element_http }}"
when: reverse_proxy_type != 'none' and reverse_proxy_type != 'traefik' when: reverse_proxy_type != 'none' and reverse_proxy_type != 'traefik'

View File

@@ -7,7 +7,7 @@ dependencies:
docker_image_http_port: 3000 docker_image_http_port: 3000
docker_database: postgres docker_database: postgres
docker_mounts: docker_mounts:
- name: gitea_data - name: data
path: /data path: /data
- src: /var/lib/gitea/.ssh/ - src: /var/lib/gitea/.ssh/
path: /data/git/.ssh path: /data/git/.ssh
@@ -26,7 +26,7 @@ dependencies:
GITEA__mailer__ENABLED: "true" GITEA__mailer__ENABLED: "true"
GITEA__mailer__HOST: "{{ smtp_server }}:587" GITEA__mailer__HOST: "{{ smtp_server }}:587"
GITEA__mailer__FROM: "{{ smtp_from }}" GITEA__mailer__FROM: "{{ smtp_from }}"
GITEA__mailer__MAILER_TYPE: smtp GITEA__mailer__PROTOCOL: smtp
GITEA__mailer__USER: "{{ smtp_user | default(omit) }}" GITEA__mailer__USER: "{{ smtp_user | default(omit) }}"
GITEA__mailer__PASSWD: "{{ smtp_pw | default(omit) }}" GITEA__mailer__PASSWD: "{{ smtp_pw | default(omit) }}"
GITEA__service__REQUIRE_SIGNIN_VIEW: "{{ gitea_require_signin_view | default(omit) }}" GITEA__service__REQUIRE_SIGNIN_VIEW: "{{ gitea_require_signin_view | default(omit) }}"

View File

@@ -88,4 +88,6 @@ argument_specs:
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false

View File

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

View File

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

View File

@@ -7,5 +7,5 @@ dependencies:
vhost_id: jitsi vhost_id: jitsi
vhost_domains: vhost_domains:
- "{{ jitsi_domain }}" - "{{ jitsi_domain }}"
vhost_proxy_target: http://127.0.0.1:{{ ports.jitsi_http }} vhost_proxy_target_port: "{{ ports.jitsi_http }}"
when: reverse_proxy_type != 'traefik' when: reverse_proxy_type != 'traefik'

View File

@@ -133,3 +133,13 @@
- name: meet.jitsi - name: meet.jitsi
aliases: aliases:
- jvb.meet.jitsi - 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: quay.io/keycloak/keycloak:latest
docker_image_http_port: 8080 docker_image_http_port: 8080
docker_database: postgres docker_database: postgres
docker_command: start docker_command: start --proxy-headers xforwarded
docker_env: docker_env:
KEYCLOAK_ADMIN: admin KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: "{{ keycloak_admin_pw }}" KEYCLOAK_ADMIN_PASSWORD: "{{ keycloak_admin_pw }}"
KC_HOSTNAME: "{{ docker_vhost_domains.keycloak[0] }}" KC_HOSTNAME: "{{ docker_vhost_domains.keycloak[0] }}"
KC_HTTP_ENABLED: "true" KC_HTTP_ENABLED: "true"
KC_PROXY: edge
KC_DB: postgres KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak_db/keycloak KC_DB_URL: jdbc:postgresql://keycloak_db/keycloak
KC_DB_USERNAME: keycloak KC_DB_USERNAME: keycloak

View File

@@ -144,6 +144,9 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "Passed to container role" description: "Passed to container role"
required: false required: false
docker_vhost_additional_locations:
description: "Passed to container role"
required: false
docker_entrypoint: docker_entrypoint:
description: "Passed to container role" description: "Passed to container role"
required: false required: false

View File

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

View File

@@ -7,10 +7,12 @@ docker_restart_policy: always
reverse_proxy_type: caddy reverse_proxy_type: caddy
docker_proxy_target_protocol: http docker_proxy_target_protocol: http
docker_vhost_additional_locations: []
docker_additional_env: {} docker_additional_env: {}
docker_additional_services: [] docker_additional_services: []
docker_database: none docker_database: none
docker_postgres_tag: 14-alpine
docker_mounts: [] docker_mounts: []
docker_network_mode: "" docker_network_mode: ""
docker_networks: [] docker_networks: []

View File

@@ -54,6 +54,11 @@ argument_specs:
set a password for the mariadb root user set a password for the mariadb root user
type: dict type: dict
required: false required: false
docker_postgres_tag:
description: 'Postgresql version to use. Can be debian (n) or alpine-based (n-alpine), where n can be major version like 14 or minor like 14.13.'
type: str
required: false
default: 14-alpine
docker_mariadb_config: docker_mariadb_config:
description: | description: |
A dict specifying config for mariadb. For example A dict specifying config for mariadb. For example
@@ -163,6 +168,10 @@ argument_specs:
docker_vhost_domains: docker_vhost_domains:
description: "docker_vhost_domains[docker_service] is a list which defines which domains should be proxied to the container. Required if reverse_proxy_type is not none. docker_vhost_domains[docker_service + '-phpmyadmin'] is used for phpmyadmin" description: "docker_vhost_domains[docker_service] is a list which defines which domains should be proxied to the container. Required if reverse_proxy_type is not none. docker_vhost_domains[docker_service + '-phpmyadmin'] is used for phpmyadmin"
type: dict type: dict
docker_vhost_additional_locations:
description: "Passed to vhost role as vhost_locations variable"
required: false
default: []
docker_published_ports: docker_published_ports:
description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)" description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)"
type: list type: list

View File

@@ -2,7 +2,7 @@
- name: Set postgres container vars - name: Set postgres container vars
ansible.builtin.set_fact: ansible.builtin.set_fact:
db_container_image: 'postgres:14-alpine' db_container_image: 'postgres:{{ docker_postgres_tag }}'
db_container_env: db_container_env:
POSTGRES_USER: "{{ docker_service_underscore_name }}" POSTGRES_USER: "{{ docker_service_underscore_name }}"
POSTGRES_PASSWORD: "{{ database_passwords[docker_service_name] }}" POSTGRES_PASSWORD: "{{ database_passwords[docker_service_name] }}"
@@ -54,7 +54,7 @@
docker_image: "{{ db_container_image }}" docker_image: "{{ db_container_image }}"
reverse_proxy_type: none reverse_proxy_type: none
docker_mounts: "{{ db_container_mounts }}" docker_mounts: "{{ db_container_mounts }}"
docker_published_ports: "{{ db_published_ports | default([]) }}" docker_published_ports: "{{ db_published_ports }}"
docker_env: "{{ db_container_env | default({}) }}" docker_env: "{{ db_container_env | default({}) }}"
docker_additional_env: {} docker_additional_env: {}
docker_networks: [] docker_networks: []

View File

@@ -68,4 +68,4 @@
image_user: "{{ container_image.Config.User }}" image_user: "{{ container_image.Config.User }}"
when: when:
- not ansible_check_mode - 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_service_name: "{{ docker_service_name }}"
_docker_mount_definition: "{{ docker_mount_definition }}" _docker_mount_definition: "{{ docker_mount_definition }}"
_container_published_ports: "{{ container_published_ports }}" _container_published_ports: "{{ container_published_ports }}"
_docker_published_ports: "{{ docker_published_ports }}"
_container_image: "{{ container_image }}" _container_image: "{{ container_image }}"
_container_networks: "{{ container_networks }}" _container_networks: "{{ container_networks }}"
_template_mounts_needed: "{{ template_mounts_needed }}" _template_mounts_needed: "{{ template_mounts_needed }}"
@@ -34,6 +35,7 @@
container_image: '' container_image: ''
image_user: '' image_user: ''
container_networks: [] container_networks: []
db_published_ports: []
- name: Add suffix to docker_service_name - name: Add suffix to docker_service_name
ansible.builtin.set_fact: ansible.builtin.set_fact:

View File

@@ -1,6 +1,6 @@
--- ---
- name: Container role initialization - name: Role initialization
import_tasks: init.yml import_tasks: init.yml
- name: Docker network - name: Docker network
@@ -68,8 +68,8 @@
ansible.builtin.file: ansible.builtin.file:
path: "{{ docker_mounts_dir }}" path: "{{ docker_mounts_dir }}"
state: directory state: directory
owner: "{{ user.uid | default(omit) }}" owner: "{{ user.uid if docker_host_user else omit }}"
group: "{{ user.group | default(omit) }}" group: "{{ user.group if docker_host_user else omit }}"
mode: 0700 mode: 0700
- name: Database container - name: Database container
@@ -123,6 +123,7 @@
docker_service_name: "{{ _docker_service_name }}" docker_service_name: "{{ _docker_service_name }}"
docker_mount_definition: "{{ _docker_mount_definition }}" docker_mount_definition: "{{ _docker_mount_definition }}"
container_published_ports: "{{ _container_published_ports }}" container_published_ports: "{{ _container_published_ports }}"
docker_published_ports: "{{ _docker_published_ports }}"
container_image: "{{ _container_image }}" container_image: "{{ _container_image }}"
container_networks: "{{ _container_networks }}" container_networks: "{{ _container_networks }}"
template_mounts_needed: "{{ _template_mounts_needed }}" template_mounts_needed: "{{ _template_mounts_needed }}"

View File

@@ -41,7 +41,8 @@
copy: copy:
src: "files/{{ item.copypath }}" src: "files/{{ item.copypath }}"
dest: "{{ docker_mounts_dir }}/" 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 when: item.copypath is defined
loop: "{{ docker_mounts }}" loop: "{{ docker_mounts }}"
notify: Restart container notify: Restart container

View File

@@ -16,7 +16,8 @@
vhost_id: "{{ docker_service_name }}" vhost_id: "{{ docker_service_name }}"
vhost_proxy_target_protocol: "{{ docker_proxy_target_protocol }}" vhost_proxy_target_protocol: "{{ docker_proxy_target_protocol }}"
vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}" vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}"
vhost_proxy_target_port: "{{ ports[docker_service_name][proxy_target_protocol] }}" vhost_proxy_target_port: "{{ ports[docker_service_name][vhost_proxy_target_protocol] }}"
vhost_locations: "{{ docker_vhost_additional_locations }}"
when: reverse_proxy_type != 'traefik' when: reverse_proxy_type != 'traefik'
- name: Set published ports variable to http port - name: Set published ports variable to http port

View File

@@ -1 +0,0 @@
Sets up an UISP docker container.

View File

@@ -1,18 +0,0 @@
---
- name: UISP container
import_role:
name: container
vars:
docker_service: uisp
docker_proxy_target_protocol: https
docker_image: nico640/docker-unms
docker_image_http_port: 8443
docker_mounts:
- name: config
path: /config
docker_published_ports:
- "0.0.0.0:{{ ports.uisp.netflow }}:2055"
docker_env:
HTTPS_PORT: "8443"
PUBLIC_HTTPS_PORT: "443"

View File

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

View File

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