- Jinja 100%
| .ansible/collections/ansible_collections/silvarion/databases | ||
| changelogs | ||
| playbooks | ||
| roles | ||
| AGENT.md | ||
| CHANGELOG.rst | ||
| galaxy.yml | ||
| README.md | ||
silvarion.databases
Ansible collection providing standardized, production-oriented roles for installing and managing databases on Linux: MySQL, MariaDB, PostgreSQL, Redis, and ProxySQL.
Every database role follows the same shape — vendor-repo installation, <role>_config_*
configuration variables, user/role management, a Prometheus exporter, and scheduled
backups — so once you know one role, you know how to operate the others. See AGENT.md
for the conventions all roles share, and each role's own AGENT.md for what's specific
to it.
Roles
| Role | Status | Description |
|---|---|---|
mysql |
Implemented | MySQL Community Server, GTID replication, xtrabackup |
mariadb |
Implemented | MariaDB Server, GTID replication, mariabackup |
pgsql |
Implemented | PostgreSQL, pg_basebackup |
redis |
Implemented | Redis with ACL users, RDB backups |
proxysql |
Implemented | ProxySQL query router, standalone or clustered |
Requirements
- Ansible >= 2.14
- Collection dependencies vary per role — see each role's README for the exact
community.*collections it needs (community.mysql,community.postgresql,community.proxysql,community.general). - Supported platforms: RHEL/Rocky/AlmaLinux 9, Ubuntu 22.04 (jammy) / 24.04 (noble), Debian 12 (bookworm) — ProxySQL currently supports RHEL 9 and Ubuntu only.
Installation
ansible-galaxy collection install silvarion.databases
Usage
Reference a role by its fully-qualified collection name (FQCN):
- hosts: db_servers
roles:
- role: silvarion.databases.mysql
vars:
mysql_bootstrap: true
mysql_root_pswd: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/db/mysql:root_password') }}"
mysql_owner_name: myapp
mysql_owner_host: "%"
mysql_owner_pswd: "{{ lookup('community.hashi_vault.hashi_vault', 'secret/db/mysql:owner_password') }}"
Each role documents its own required variables, tags, and example playbooks in its README — start there for the specifics of the database you're deploying.
Core Principles
- Keep it simple — code stays as readable and straightforward as possible; no abstraction that doesn't earn its complexity.
- Keep it clear — consistent naming and structure across roles, so a contributor who understands one role feels at home in another.
- Keep it working — no unannounced downtime; any task that stops a running service says so explicitly in its name and, where relevant, a comment.
- Keep it secure — no passwords, secrets, or tokens in the repository; credentials always come from a secrets manager via a lookup plugin.
Playbooks
Collection-level example playbooks live under playbooks/.
Contributing
Feel free to open an issue or contact the maintainer to collaborate.
Support
Feel free to create issues on the project or contact the maintainer directly.
Authors and acknowledgment
Author: Jesus Alejandro Sanchez Davila
Maintainer: Jesus Alejandro Sanchez Davila
Email: jsanchez.consultant@gmail.com
License
MIT