Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/punktde/ansible-proserver-mariadb
Ansible role to configure MariaDB on a proServer.
https://github.com/punktde/ansible-proserver-mariadb
ansible database mariadb mysql proserver
Last synced: 15 days ago
JSON representation
Ansible role to configure MariaDB on a proServer.
- Host: GitHub
- URL: https://github.com/punktde/ansible-proserver-mariadb
- Owner: punktDe
- License: mit
- Created: 2017-11-03T13:30:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-13T16:36:48.000Z (about 2 months ago)
- Last Synced: 2024-12-13T17:45:06.207Z (about 2 months ago)
- Topics: ansible, database, mariadb, mysql, proserver
- Language: Shell
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [proserver-ansible-mariadb](https://github.com/punktDe/proserver-ansible-mariadb)
Ansible role to configure MariaDB on a proServer.
## Requirements
- A proServer
- Ansible >=2.9.0
- Ansible option `hash_behaviour` set to `merge`## Configuration
**1)** Add the role to your playbook.
You could add this repository as submodule to your Ansible project's Git repository.```
git submodule add https://github.com/punktDe/proserver-ansible-mariadb.git roles/mariadb
``````yaml
---
- name: mariadb
hosts: all
become: yes
roles:
- mariadb
```**2)** Configure what databases you'd like to have (in host vars, group vars or wherever).
```yaml
---
mariadb:
databases:
cms:
name: mydb
users:
cms:
username: myuser
password: mypass
hosts:
cms: localhost
privileges:
cms_all: "mydb.*:all"
```With these variables the role will ensure that
- there is a database `mydb`
- there is a user `myuser@localhost` with password `mypass`
- `myuser` has all privileges on `mydb`The value `cms` and `cms_all` is never used.
You can use it to override previously defined variables
(e.g. override options from group vars in host vars).Let's assume the example above comes from your group vars and
the example below comes from your host vars.```yaml
---
mariadb:
users:
cms:
hosts:
cms: 172.17.78.2
privileges:
cms_all:
cms_readall: "mydb.*:select,show view"
```The role would ensure that
- there is a database `mydb`
- there is a user `[email protected]` with password `mypass`
- `myuser` has read privileges (`create` and `show view`) on `mydb`## Full example
This example shows all available variables.
```yaml
---
mariadb:
database_defaults:
encoding: utf8mb4
collation: utf8mb4_unicode_ci
databases:
example_db:
encoding: utf8mb4
collation: utf8mb4_unicode_ci
name: example
users:
example_user:
username: example
password: example
hosts:
example_host: localhost
privileges:
example_privilege: "example.*:all"
```## Further Documentation
* [Galera Cluster](./documentation/galera.md)