An ansible playbook for MariaDB on CentOS 7
This playbook is idempotent and is safe to run against running systems.
database
- a standalone MariaDB servermidpoint
- create a database for midPoint
This playbook assumes that there is a separate disk device available for database data. For an example virtual disk configuration, see the Terraform MariaDB module.
IMPORTANT! It is assumed that the data disk device is /dev/sdb
.
For dev
, stage
, prod
, etc., create an inventory file for each infrastructure type.
Example inventory/dev
:
[dev]
mariadb-dev.someplace.edu
mariadb-dev2.someplace.edu
[midpoint]
mariadb-dev2.someplace.edu
To apply the midpoint
role to a host, create a [midpoint]
group and add the host(s) to it.
Then, create a variable file for each dev
, stage
, prod
type in the inventory.
Example group_vars/dev
:
---
mariadb:
datadir: /data/mysql
innodb_buffer_pool_size: changeme
max_allowed_packet: changeme
backupsdir: /data/backups
backupsdir
- dir for database backup dumpfiles. NOTE: backups are configured on a per-role basis. Themidpoint
role is an example of how this can be done.
Add the following to the variable file:
midpoint:
midpoint_host: changeme
db_name: changeme
db_username: changeme
db_password: changeme
db_create_script_url: https://raw.githubusercontent.com/Evolveum/midpoint/v3.8/config/sql/_all/mysql-3.8-all-utf8mb4.sql
midpoint_host
(required) - hostname of midPoint application server that will connect to this databasedb_name
(required) - name of database to createdb_username
(required) - database user's usernamedb_password
(required) - database user's passworddb_create_script_url
- path to the database creation script for the target version of midPoint
See group_vars/example-dist
for an example.
$ ansible-playbook -i inventory/dev site.yml