mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added pgadmin draft and optimized phpadmin
This commit is contained in:
29
roles/docker-pgadmin/README.md
Normal file
29
roles/docker-pgadmin/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# PgAdmin 🐳
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role deploys [pgAdmin](https://www.pgadmin.org/) in a secure Docker environment, with optional OAuth2 proxy support. It provides a full-featured web UI to manage PostgreSQL databases, making it ideal for both development and production use.
|
||||
|
||||
## Overview
|
||||
|
||||
The role provisions a containerized pgAdmin instance using Docker Compose. It allows integration with central PostgreSQL servers, and supports environment-specific settings via Ansible variables.
|
||||
|
||||
## Purpose
|
||||
|
||||
The purpose of this role is to offer a quick and configurable way to deploy pgAdmin with Docker, while keeping it secure through optional OAuth2 integration. It's built to fit seamlessly into CyMaIS-managed environments.
|
||||
|
||||
## Features
|
||||
|
||||
- **Docker Compose Integration:** Deploy pgAdmin with a templated Compose file.
|
||||
- **OAuth2 Proxy Support:** Add authentication via an external OAuth2 provider.
|
||||
- **Central DB Integration:** Easily connect to central PostgreSQL instances.
|
||||
- **Customizable Settings:** Adjust container configuration via Ansible variables.
|
||||
- **Healthchecks & Networking:** Includes built-in Docker healthchecks and Compose networks.
|
||||
|
||||
## Credits 📝
|
||||
|
||||
Developed and maintained by **Kevin Veen-Birkenbach**.
|
||||
Learn more at [www.veen.world](https://www.veen.world)
|
||||
|
||||
Part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais)
|
||||
License: [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl)
|
25
roles/docker-pgadmin/meta/main.yml
Normal file
25
roles/docker-pgadmin/meta/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: "pgAdmin with optional OAuth2 proxy integration."
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
min_ansible_version: "2.9"
|
||||
platforms:
|
||||
- name: Archlinux
|
||||
versions:
|
||||
- rolling
|
||||
galaxy_tags:
|
||||
- pgadmin
|
||||
- docker
|
||||
- webui
|
||||
- oauth2
|
||||
- postgresql
|
||||
repository: https://s.veen.world/cymais
|
||||
issue_tracker_url: https://s.veen.world/cymaisissues
|
||||
documentation: https://s.veen.world/cymais
|
||||
dependencies: []
|
14
roles/docker-pgadmin/tasks/main.yml
Normal file
14
roles/docker-pgadmin/tasks/main.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: "include docker-compose role"
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: "include role nginx-domain-setup for {{application_id}}"
|
||||
include_role:
|
||||
name: nginx-domain-setup
|
||||
vars:
|
||||
domain: "{{ domains[application_id] }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
19
roles/docker-pgadmin/templates/docker-compose.yml.j2
Normal file
19
roles/docker-pgadmin/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
|
||||
{% include 'roles/docker-oauth2-proxy/templates/container.yml.j2' %}
|
||||
|
||||
application:
|
||||
image: dpage/pgadmin4:{{applications.pgadmin.version}}
|
||||
container_name: pgadmin
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
ports:
|
||||
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
|
||||
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
|
||||
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
{% include 'templates/docker/compose/networks.yml.j2' %}
|
5
roles/docker-pgadmin/templates/env.j2
Normal file
5
roles/docker-pgadmin/templates/env.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
# Configuration @see https://hub.docker.com/r/dpage/pgadmin4
|
||||
|
||||
PGADMIN_DEFAULT_EMAIL={{ applications.pgadmin.default_email }}
|
||||
PGADMIN_DEFAULT_PASSWORD={{ applications.pgadmin.default_password }}
|
||||
PGADMIN_DISABLE_POSTFIX=True
|
3
roles/docker-pgadmin/vars/main.yml
Normal file
3
roles/docker-pgadmin/vars/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
application_id: "pgadmin"
|
||||
database_type: "postgresql"
|
||||
database_host: "{{ 'central-' + database_type if applications[application_id].database.central_storage }}"
|
Reference in New Issue
Block a user