diff --git a/docs/services/mariadb.md b/docs/services/mariadb.md new file mode 100644 index 0000000..0a467a6 --- /dev/null +++ b/docs/services/mariadb.md @@ -0,0 +1,54 @@ +# MariaDB + +[MariaDB](https://mariadb.org/) is a powerful, open source object-relational database system. + +Some of the services installed by this playbook require a MariaDB database. + +Enabling the MariaDB database service will automatically wire all other services which require such a database to use it. + + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# mariadb # +# # +######################################################################## + +mariadb_enabled: true + +# Put a strong password below, generated with `pwgen -s 64 1` or in another way +mariadb_root_passsword: '' + +######################################################################## +# # +# /mariadb # +# # +######################################################################## +``` + +### Getting a database terminal + +You can use the `/mash/mariadb/bin/cli` tool to get interactive terminal access to the MariaDB server. + +To see the available databases, run `SHOW DATABASES`. + +To change to another existing database (for example `miniflux`), run `USE miniflux`. + +You can then proceed to write queries. Example: `SELECT COUNT(*) FROM users;` + +**Be careful**. Modifying the database directly (especially as services are running) is dangerous and may lead to irreversible database corruption. +When in doubt, consider [making a backup](#backing-up-mariadb). + +## Upgrading MariaDB + +The major MariaDB version you start with (e.g. `10.10` or `10.11`) will be kept until you manually upgrade it. The playbook will stick to this major version and only do minor version upgrades (e.g. `10.10.1` -> `10.10.3`). + +For now, there's no automatic upgrade path between major MariaDB versions, but support for upgrading will be added in the future. + +## Backing up MariaDB + +A `/mash/mariadb/bin/dump-all` script will be installed, which can dump the database to a path of your choosing. diff --git a/docs/supported-services.md b/docs/supported-services.md index fb04e46..15abd77 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -18,6 +18,7 @@ | [Hubsite](https://github.com/moan0s/hubsite) | A simple, static site that shows an overview of the available services | [Link](services/hubsite.md) | | [Jitsi](https://jitsi.org/) | A fully encrypted, 100% Open Source video conferencing solution | [Link](services/jitsi.md) | | [Keycloak](https://www.keycloak.org/) | An open source identity and access management solution. | [Link](services/keycloak.md) | +| [MariaDB](https://mariadb.org/) | A powerful, open source object-relational database system | [Link](services/mariadb.md) | | [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](services/miniflux.md) | | [Navidrome](https://www.navidrome.org/) | [Subsonic-API](http://www.subsonic.org/pages/api.jsp) compatible music server | [Link](services/navidrome.md) | [NetBox](https://docs.netbox.dev/en/stable/) | Web application that provides [IP address management (IPAM)](https://en.wikipedia.org/wiki/IP_address_management) and [data center infrastructure management (DCIM)](https://en.wikipedia.org/wiki/Data_center_management#Data_center_infrastructure_management) functionality | [Link](services/netbox.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 7fa2863..c603624 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -121,6 +121,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (nextcloud_identifier + '-cron.timer'), 'priority': 2500, 'groups': ['mash', 'nextcloud', 'nextcloud-cron']}] if nextcloud_enabled else []) + + ([{'name': (mariadb_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'mariadb']}] if mariadb_enabled else []) + + ([{'name': (owncast_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'owncast']}] if owncast_enabled else []) + ([{'name': (peertube_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'peertube']}] if peertube_enabled else []) @@ -1292,6 +1294,34 @@ netbox_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | +######################################################################## +# # +# mariadb # +# # +######################################################################## + +mariadb_enabled: false + +mariadb_identifier: "{{ mash_playbook_service_identifier_prefix }}mariadb" + +mariadb_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}mariadb" + +mariadb_uid: "{{ mash_playbook_uid }}" +mariadb_gid: "{{ mash_playbook_gid }}" + +# This will be extended in the future, to auto-create datases for services +# which depend on MariaDB. +# See `devture_postgres_managed_databases_auto` +mariadb_managed_databases_auto: [] + +######################################################################## +# # +# /mariadb # +# # +######################################################################## + + + ######################################################################## # # # owncast # diff --git a/requirements.yml b/requirements.yml index ce4d4c3..118fdf8 100644 --- a/requirements.yml +++ b/requirements.yml @@ -84,6 +84,9 @@ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-nextcloud.git version: v26.0.0-4 name: nextcloud +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mariadb.git + version: v10.11.2-0 + name: mariadb - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-owncast.git version: v0.0.13-0 name: owncast diff --git a/setup.yml b/setup.yml index 0cfdb1d..5d141df 100644 --- a/setup.yml +++ b/setup.yml @@ -74,6 +74,8 @@ - role: galaxy/grafana + - role: galaxy/mariadb + - role: galaxy/miniflux - role: galaxy/hubsite