Improve documentation

Add molecule cluster example.
Add spellcheck pre-commit.
This commit is contained in:
Faustin Lammler 2022-10-12 19:18:56 +02:00
parent a7989e042d
commit 63e215f3e6
No known key found for this signature in database
GPG Key ID: 390A2F27832A5C79
3 changed files with 29 additions and 10 deletions

2
.codespellrc Normal file
View File

@ -0,0 +1,2 @@
[codespell]
ignore-words-list=ro

View File

@ -27,6 +27,13 @@ repos:
# args: ["-x", "602"] # args: ["-x", "602"]
exclude_types: [markdown, shell] exclude_types: [markdown, shell]
types: [yaml] types: [yaml]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
name: Checks for common misspellings in text files
entry: codespell
language: python
- repo: local - repo: local
hooks: hooks:
- id: docker-markdownlint - id: docker-markdownlint

View File

@ -1,8 +1,9 @@
# Ansible role: MariaDB # Ansible role: MariaDB
[![pre-commit](https://github.com/fauust/ansible-role-mariadb/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/pre-commit.yml) [![pre-commit](https://github.com/fauust/ansible-role-mariadb/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/pre-commit.yml)
[![default](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_default.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_default.yml) [![Default](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_default.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_default.yml)
[![MDBF](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_mdbf.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_mdbf.yml) [![MDBF](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_mdbf.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_mdbf.yml)
[![Cluster](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_cluster.yml/badge.svg)](https://github.com/fauust/ansible-role-mariadb/actions/workflows/test_cluster.yml)
Install and configure MariaDB Server on Debian/Ubuntu. Install and configure MariaDB Server on Debian/Ubuntu.
@ -18,7 +19,7 @@ The role uses
and and
[`community.mysql.mysql_db`](https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_db_module.html) [`community.mysql.mysql_db`](https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_db_module.html)
ansible modules that depend on [PyMySQL](https://github.com/PyMySQL/PyMySQL). ansible modules that depend on [PyMySQL](https://github.com/PyMySQL/PyMySQL).
Only Python 3.X versions are supported and tested. Python 2.7 is probalbly Only Python 3.X versions are supported and tested. Python 2.7 is probably
working but not tested. working but not tested.
### pre-commit ### pre-commit
@ -31,10 +32,10 @@ code will pass the checks, you can execute the pre-commit checks locally before
Here is how: Here is how:
```console ```console
make venv make venv
source .venv/bin/activate source .venv/bin/activate
make install-pre-commit .venv make install-pre-commit
make pre-commit-run .venv make pre-commit-run
``` ```
You can also [install](https://pre-commit.com/#install) the pre-commit tool so You can also [install](https://pre-commit.com/#install) the pre-commit tool so
@ -60,6 +61,15 @@ packaged by the MariaDB Foundation (MDBF) on `Almalinux 9`:
... ...
``` ```
And here is another example how you can test a deployment of a MariaDB Server
cluster (3 nodes: 1 primary, 2 replica) on `fedora 37`:
```console
.venv export MOLECULE_DISTRO=fedora-37
.venv molecule test -s cluster
...
```
## Fact gathering (performance) ## Fact gathering (performance)
Fact gathering is only needed if you want to use the MariaDB official repository Fact gathering is only needed if you want to use the MariaDB official repository
@ -102,12 +112,12 @@ variables. This permits more flexibility and a very simple
[`templates/mariadb.cnf.j2`](./templates/mariadb.cnf.j2) file. [`templates/mariadb.cnf.j2`](./templates/mariadb.cnf.j2) file.
By default, some common and standard options are deployed based on the MariaDB By default, some common and standard options are deployed based on the MariaDB
Foundation package. Those default values are only ment as an example and for testing Foundation package. Those default values are only meant as an example and for testing
deployments and you are encouraged to use your own values. deployments and you are encouraged to use your own values.
#### Basic settings #### Basic settings
`default value depends on OS` means that the value is overrided at OS level, see `default value depends on OS` means that the value is overridden at OS level, see
[`vars`](./vars). [`vars`](./vars).
```yaml ```yaml
@ -133,7 +143,7 @@ mariadb_basic_settings_raw: |
bind-address = {{ mariadb_bind_address }} bind-address = {{ mariadb_bind_address }}
``` ```
#### Fine tuning #### Fine-tuning
```yaml ```yaml
mariadb_fine_tuning_raw: | mariadb_fine_tuning_raw: |
@ -174,7 +184,7 @@ mariadb_character_sets_raw: |
```yaml ```yaml
mariadb_innodb_raw: | mariadb_innodb_raw: |
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # InnoDB is enabled by default with a 10 MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many! # Read the manual for more InnoDB related options. There are many!
``` ```