Compare commits
4 Commits
e51052c34b
...
234bb70d73
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
234bb70d73 | ||
|
|
7af0e08dfc | ||
|
|
09daba7fd7 | ||
|
|
a2225cea5f |
@@ -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.8.4
|
version: 0.8.5
|
||||||
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.5'
|
uumas.general: '>=0.5.8'
|
||||||
authors:
|
authors:
|
||||||
- uumas
|
- uumas
|
||||||
|
|||||||
@@ -4,4 +4,7 @@ docker_host_user: false
|
|||||||
docker_volume_type: named
|
docker_volume_type: named
|
||||||
docker_mariadb_config: {}
|
docker_mariadb_config: {}
|
||||||
|
|
||||||
|
docker_phpmyadmin_basicauth: true
|
||||||
|
docker_phpmyadmin_basicauth_users: {}
|
||||||
|
|
||||||
timezone: Etc/UTC
|
timezone: Etc/UTC
|
||||||
|
|||||||
@@ -58,6 +58,16 @@ argument_specs:
|
|||||||
choices:
|
choices:
|
||||||
- memcached
|
- memcached
|
||||||
default: []
|
default: []
|
||||||
|
docker_phpmyadmin_basicauth:
|
||||||
|
description: Whether to enable basicauth for phpmyadmin
|
||||||
|
type: bool
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
docker_phpmyadmin_basicauth_users:
|
||||||
|
description: Dict of users and their password hashes for phpmyadmin basic auth. Required if docker_phpmyadmin_basicauth is true and phpmyadmin is used.
|
||||||
|
type: dict
|
||||||
|
required: false
|
||||||
|
default: {}
|
||||||
|
|
||||||
docker_volume_type:
|
docker_volume_type:
|
||||||
description: "Defines whether to use named volumes or bind mounts for mounts with name"
|
description: "Defines whether to use named volumes or bind mounts for mounts with name"
|
||||||
@@ -118,10 +128,10 @@ argument_specs:
|
|||||||
- https
|
- https
|
||||||
default: http
|
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. If ports[docker_service]['phpmyadmin'] is defined and docker_database is mariadb, phpmyadmin will is installed."
|
||||||
type: dict
|
type: dict
|
||||||
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"
|
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_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>)"
|
||||||
|
|||||||
@@ -77,3 +77,18 @@
|
|||||||
mounts: "{{ db_container_mount_definition }}"
|
mounts: "{{ db_container_mount_definition }}"
|
||||||
networks: "{{ container_networks | default(omit) }}"
|
networks: "{{ container_networks | default(omit) }}"
|
||||||
log_driver: local
|
log_driver: local
|
||||||
|
|
||||||
|
- name: phpMyAdmin container for {{ docker_service_name }}
|
||||||
|
docker_container:
|
||||||
|
name: "{{ docker_service_name }}_phpmyadmin"
|
||||||
|
image: phpmyadmin
|
||||||
|
pull: true
|
||||||
|
env:
|
||||||
|
PMA_ABSOLUTE_URI: "https://{{ docker_vhost_domains[docker_service_name + '_phpmyadmin'][0] }}"
|
||||||
|
PMA_HOST: "{{ docker_service_name }}_db"
|
||||||
|
published_ports:
|
||||||
|
- "127.0.0.1:{{ ports[docker_service_name]['phpmyadmin'] }}:80"
|
||||||
|
restart_policy: always
|
||||||
|
networks: "{{ container_networks | default(omit) }}"
|
||||||
|
log_driver: local
|
||||||
|
when: docker_database == 'mariadb' and ports[docker_service_name]['phpmyadmin'] is defined
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
- name: Reverse proxy
|
- name: Reverse proxy
|
||||||
include_role:
|
include_role:
|
||||||
name: uumas.general.reverse_proxy
|
name: uumas.general.vhost
|
||||||
vars:
|
vars:
|
||||||
|
vhost_type: reverse_proxy
|
||||||
vhost_id: "{{ docker_service_name }}"
|
vhost_id: "{{ docker_service_name }}"
|
||||||
proxy_target_protocol: "{{ docker_proxy_target_protocol }}"
|
proxy_target_protocol: "{{ docker_proxy_target_protocol }}"
|
||||||
vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}"
|
vhost_domains: "{{ docker_vhost_domains[docker_service_name] }}"
|
||||||
@@ -20,3 +21,15 @@
|
|||||||
- name: Include traefik vars
|
- name: Include traefik vars
|
||||||
include_vars: traefik.yml
|
include_vars: traefik.yml
|
||||||
when: reverse_proxy_type == 'traefik'
|
when: reverse_proxy_type == 'traefik'
|
||||||
|
|
||||||
|
- name: Reverse proxy for phpmyadmin
|
||||||
|
include_role:
|
||||||
|
name: uumas.general.vhost
|
||||||
|
vars:
|
||||||
|
vhost_type: reverse_proxy
|
||||||
|
vhost_id: "{{ docker_service_name }}_phpmyadmin"
|
||||||
|
vhost_domains: "{{ docker_vhost_domains[docker_service_name + '_phpmyadmin'] }}"
|
||||||
|
proxy_target_port: "{{ ports[docker_service_name]['phpmyadmin'] }}"
|
||||||
|
vhost_basicauth: "{{ docker_phpmyadmin_basicauth }}"
|
||||||
|
vhost_basicauth_users: "{{ docker_phpmyadmin_basicauth_users }}"
|
||||||
|
when: docker_database == 'mariadb' and ports[docker_service_name]['phpmyadmin'] is defined
|
||||||
|
|||||||
Reference in New Issue
Block a user