mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented pre configuration for pgadmin
This commit is contained in:
@@ -3,7 +3,7 @@ services:
|
||||
{% include 'roles/docker-oauth2-proxy/templates/container.yml.j2' %}
|
||||
|
||||
application:
|
||||
image: dpage/pgadmin4:{{applications.pgadmin.version}}
|
||||
image: dpage/pgadmin4:{{applications[application_id].version}}
|
||||
container_name: pgadmin
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
ports:
|
||||
@@ -15,5 +15,14 @@ services:
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
volumes:
|
||||
- "data:/var/lib/pgadmin"
|
||||
{% if applications[application_id].server_mode | bool %}
|
||||
- "{{ pgadmin_host_server_file }}:{{ pgadmin_docker_server_file }}"
|
||||
- "{{ pgadmin_host_password_file }}:{{ pgadmin_docker_password_file }}"
|
||||
{% endif %}
|
||||
|
||||
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
||||
data:
|
||||
|
||||
{% include 'templates/docker/compose/networks.yml.j2' %}
|
@@ -1,5 +1,21 @@
|
||||
# Configuration @see https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html
|
||||
|
||||
# Disable postfix integration (not needed in containerized environments)
|
||||
PGADMIN_DISABLE_POSTFIX=True
|
||||
|
||||
# Default login email for server mode
|
||||
PGADMIN_DEFAULT_EMAIL={{ applications[application_id].users.administrator.email }}
|
||||
|
||||
# Default login password for server mode
|
||||
PGADMIN_DEFAULT_PASSWORD={{ applications[application_id].users.administrator.password }}
|
||||
PGADMIN_DISABLE_POSTFIX=True
|
||||
|
||||
{% if applications[application_id].server_mode | bool %}
|
||||
# Load server connection settings from this JSON file
|
||||
PGADMIN_SERVER_JSON_FILE={{ pgadmin_docker_server_file }}
|
||||
|
||||
# Enable desktop (single-user) mode
|
||||
PGADMIN_CONFIG_SERVER_MODE=False
|
||||
|
||||
# Disable master password prompt for stored credentials
|
||||
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED={{ applications[application_id].master_password_required | capitalize }}
|
||||
{% endif %}
|
3
roles/docker-pgadmin/templates/pgpass.j2
Normal file
3
roles/docker-pgadmin/templates/pgpass.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for server in pgadmin_servers %}
|
||||
{{ server.host }}:{{ server.port }}:*:{{ server.username }}:{{ server.password }}
|
||||
{% endfor %}
|
16
roles/docker-pgadmin/templates/servers.json.j2
Normal file
16
roles/docker-pgadmin/templates/servers.json.j2
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"Servers": {
|
||||
{% for server in pgadmin_servers %}
|
||||
"{{ loop.index }}": {
|
||||
"Name": "{{ server.name }}",
|
||||
"Group": "Servers",
|
||||
"Host": "{{ server.host }}",
|
||||
"Port": {{ server.port }},
|
||||
"MaintenanceDB": "{{ server.maintenance_db }}",
|
||||
"Username": "{{ server.username }}",
|
||||
"SSLMode": "prefer",
|
||||
"PassFile": "/pgpass"
|
||||
}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user