Compare commits

...

4 Commits

Author SHA1 Message Date
uumas
64491514a9 v0.8.3 2023-04-18 19:38:57 +03:00
uumas
7504ba96d0 add uisp role 2023-04-18 19:38:43 +03:00
uumas
851504030a container: add proxy target protocol and network mode vars to argspec 2023-04-18 19:37:57 +03:00
uumas
6fb2e23151 container: set TZ variable 2023-04-18 19:37:29 +03:00
7 changed files with 75 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
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.8.2 version: 0.8.3
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

View File

@@ -2,3 +2,5 @@
docker_host_user: false docker_host_user: false
docker_volume_type: named docker_volume_type: named
timezone: Etc/UTC

View File

@@ -96,6 +96,14 @@ argument_specs:
description: "The port for http listener inside the container. Will be mapped to the host port defined in ports. Required if reverse_proxy_type is not none." description: "The port for http listener inside the container. Will be mapped to the host port defined in ports. Required if reverse_proxy_type is not none."
type: int type: int
required: false required: false
docker_proxy_target_protocol:
description: "Protocol to use for proxy connection"
type: str
required: false
choices:
- http
- https
default: http
ports: ports:
description: "ports[docker_service]['http'] or ports[docker_service]['https'] defines the port on which the container will listen on for reverse proxy connections. Required if reverse_proxy_type is caddy." description: "ports[docker_service]['http'] or ports[docker_service]['https'] defines the port on which the container will listen on for reverse proxy connections. Required if reverse_proxy_type is caddy."
type: dict type: dict
@@ -117,3 +125,12 @@ argument_specs:
type: list type: list
required: false required: false
elements: str elements: str
docker_network_mode:
description: "Docker container network mode"
type: str
required: false
timezone:
description: "Timezone set in the TZ env var"
type: str
required: false
default: Etc/UTC

View File

@@ -66,7 +66,7 @@
mounts: "{{ docker_volume_definition }}" mounts: "{{ docker_volume_definition }}"
published_ports: "{{ container_published_ports + docker_published_ports }}" published_ports: "{{ container_published_ports + docker_published_ports }}"
labels: "{{ traefik_labels | default(omit) }}" labels: "{{ traefik_labels | default(omit) }}"
env: "{{ docker_env | combine(docker_additional_env) }}" env: "{{ docker_env | combine(docker_additional_env) | combine({'TZ': timezone}) }}"
entrypoint: "{{ docker_entrypoint | default(omit) }}" entrypoint: "{{ docker_entrypoint | default(omit) }}"
restart_policy: always restart_policy: always
network_mode: "{{ docker_network_mode | default(omit) }}" network_mode: "{{ docker_network_mode | default(omit) }}"

1
roles/uisp/README.md Normal file
View File

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

View File

@@ -0,0 +1,35 @@
---
argument_specs:
main:
short_description: UISP container
description: "Sets up an UISP docker container."
options:
ports:
description: "ports.netflow is used directly. Others passed to container role"
required: true
# All options after this will be passed directly to the container role
docker_service_suffix:
description: "Passed to container role"
required: false
docker_host_user:
description: "Passed to container role"
required: false
docker_additional_services:
description: "Passed to container role"
required: false
docker_volume_type:
description: "Passed to container role"
required: false
reverse_proxy_type:
description: "Passed to container role"
required: false
docker_vhost_domains:
description: "Passed to container role"
required: false
docker_entrypoint:
description: "Passed to container role"
required: false

18
roles/uisp/tasks/main.yml Normal file
View File

@@ -0,0 +1,18 @@
---
- 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"