From 7e31249970a4e982867e2fc5c290f5f21e292804 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 26 Jun 2015 21:45:38 -0500 Subject: [PATCH] PR #38 cleanup - change order and update README. --- README.md | 54 ++++++++++++++++++++++++++----------------------- meta/main.yml | 2 +- vars/Debian.yml | 2 +- vars/RedHat.yml | 2 +- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 95360ca..17b9f91 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/geerlingguy/ansible-role-mysql.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-mysql) -Installs MySQL server on RHEL/CentOS or Debian/Ubuntu servers. +Installs and configures MySQL or MariaDB server on RHEL/CentOS or Debian/Ubuntu servers. ## Requirements @@ -81,6 +81,34 @@ The rest of the settings in `defaults/main.yml` control MySQL's memory usage. Th Replication settings. Set `mysql_server_id` and `mysql_replication_role` by server (e.g. the master would be ID `1`, with the `mysql_replication_role` of `master`, and the slave would be ID `2`, with the `mysql_replication_role` of `slave`). The `mysql_replication_user` uses the same keys as `mysql_users`, and is created on master servers, and used to replicate on all the slaves. +### MariaDB usage + +This role works with either MySQL or a compatible version of MariaDB. On RHEL/CentOS 7+, the mariadb database engine was substituted as the default MySQL replacement package, so you should override the `mysql_packages` variable with the below configuration to make sure MariaDB is installed correctly. + +#### RHEL/CentOS 7 MariaDB configuration + +Set the following variables (at a minimum): + + mysql_packages: + - mariadb + - mariadb-server + - mariadb-libs + - MySQL-python + - perl-DBD-MySQL + mysql_daemon: mariadb + mysql_log_error: /var/log/mariadb/mariadb.log + mysql_syslog_tag: mariadb + mysql_pid_file: /var/run/mariadb/mariadb.pid + +#### Ubuntu 14.04 MariaDB configuration + +Set the following variables (at a minimum): + + mysql_packages: + - mariadb-client + - mariadb-server + - python-mysqldb + ## Dependencies None. @@ -106,30 +134,6 @@ None. password: similarly-secure-password priv: "example_db.*:ALL" - -## Mariadb usage - -For CentOS 7: - - mysql_packages: - - mariadb - - mariadb-server - - mariadb-libs - - MySQL-python - - perl-DBD-MySQL - mysql_daemon: mariadb - mysql_socket: /var/lib/mysql/mysql.sock - mysql_log_error: /var/log/mariadb/mariadb.log - mysql_syslog_tag: mariadb - mysql_pid_file: /var/run/mariadb/mariadb.pid - -For Ubuntu 14.04: - - mysql_packages: - - mariadb-client - - mariadb-server - - python-mysqldb - ## License MIT / BSD diff --git a/meta/main.yml b/meta/main.yml index 6436e07..3690a17 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,7 +3,7 @@ dependencies: [] galaxy_info: author: geerlingguy - description: MySQL server for RHEL/CentOS 6.x and Debian/Ubuntu + description: MySQL server for RHEL/CentOS and Debian/Ubuntu company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" min_ansible_version: 1.4 diff --git a/vars/Debian.yml b/vars/Debian.yml index 4b4eddc..292d71a 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,8 +1,8 @@ --- __mysql_daemon: mysql -mysql_config_file: /etc/mysql/my.cnf __mysql_packages: - mysql-common - mysql-server - python-mysqldb +mysql_config_file: /etc/mysql/my.cnf mysql_socket: /var/run/mysqld/mysqld.sock diff --git a/vars/RedHat.yml b/vars/RedHat.yml index e6a346e..088ca4f 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,8 +1,8 @@ --- __mysql_daemon: mysqld -mysql_config_file: /etc/my.cnf __mysql_packages: - mysql - mysql-server - MySQL-python +mysql_config_file: /etc/my.cnf mysql_socket: /var/lib/mysql/mysql.sock