No description
- Jinja 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitea/workflows | ||
| defaults | ||
| meta | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| README.md | ||
Metabase
Deploys a Metabase instance via Docker Compose, optionally with a managed Postgres database and Traefik reverse proxy integration.
Requirements
- Docker
community.dockerAnsible collection
Variables
| Variable | Default | Description |
|---|---|---|
metabase_instance |
metabase |
Unique instance name. Used as Compose project name and container name prefix. Change when running multiple instances on the same host. |
metabase_version |
latest |
Metabase image tag. Pin to a specific version in production. |
metabase_path |
/data/metabase |
Host path for Postgres data. |
metabase_docker_path |
/docker/metabase |
Host path for the docker-compose.yml file. |
metabase_port |
~ |
Host port to expose Metabase on. Leave null when using Traefik. |
metabase_domain |
~ |
Domain for Traefik routing. When set, adds Traefik labels and joins the traefik_web network. |
metabase_pg_enabled |
true |
Deploy a managed Postgres container. Set to false to use an external database. |
metabase_pg_version |
18-alpine |
Postgres image tag. If changed, verify the internal UID with docker run --rm postgres:<tag> id postgres and update directory ownership accordingly. |
metabase_uninstall |
false |
Stops and removes containers and the compose directory. |
metabase_purge |
false |
Also removes the data directory. Requires metabase_uninstall: true. Irreversible. |
metabase_pg_db |
metabaseappdb |
Postgres database name. |
metabase_pg_user |
metabase |
Postgres user. |
metabase_pg_pass |
~ |
Postgres password. Required when metabase_pg_enabled is true. |
metabase_pg_port |
5432 |
Postgres port (internal, not exposed to host). |
Usage
Minimal setup with port exposure:
metabase_pg_pass: "supersecret"
metabase_port: 3000
Multiple instances on the same host:
# instance 1
metabase_instance: metabase_customer_a
metabase_port: 3000
metabase_pg_pass: "secret_a"
metabase_path: /data/metabase_customer_a
# instance 2
metabase_instance: metabase_customer_b
metabase_port: 3001
metabase_pg_pass: "secret_b"
metabase_path: /data/metabase_customer_b
With Traefik:
metabase_pg_pass: "supersecret"
metabase_domain: "metabase.example.com"
Uninstall
To stop and remove all containers and the compose directory:
metabase_uninstall: true
To also wipe the Postgres data directory (irreversible):
metabase_uninstall: true
metabase_purge: true
Notes
- Postgres data directory is owned by
70:70(UID/GID ofpostgres:18-alpine). If you changemetabase_pg_version, verify the UID and re-run the role before starting the container. - Postgres is not exposed to the host — it is only reachable by the Metabase container on the internal Compose network.
- If neither
metabase_portnormetabase_domainis set, the role will warn but not fail.