From 3c88b9e8db773be90ec0e92c29fc4baa543c0617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Bold=C3=BA?= Date: Tue, 2 Jun 2015 15:29:58 +0200 Subject: [PATCH 1/5] MariaDB support --- defaults/main.yml | 1 + templates/my.cnf.j2 | 2 +- vars/Debian.yml | 2 +- vars/RedHat.yml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index cf31060c..caedf253 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,7 @@ mysql_enablerepo: "" mysql_port: "3306" mysql_bind_address: '0.0.0.0' mysql_datadir: /var/lib/mysql +__mysql_pid_file: /var/run/mysqld/mysqld.pid # Slow query log settings. mysql_slow_query_log_enabled: no diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index 476e6e5e..12c15642 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -94,4 +94,4 @@ quick max_allowed_packet = {{ mysql_mysqldump_max_allowed_packet }} [mysqld_safe] -pid-file = /var/run/mysqld/mysqld.pid +pid-file = {{ mysql_pid_file }} diff --git a/vars/Debian.yml b/vars/Debian.yml index 0a04ce0d..4b4eddcb 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,5 +1,5 @@ --- -mysql_daemon: mysql +__mysql_daemon: mysql mysql_config_file: /etc/mysql/my.cnf __mysql_packages: - mysql-common diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 055839c6..e6a346ea 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -1,5 +1,5 @@ --- -mysql_daemon: mysqld +__mysql_daemon: mysqld mysql_config_file: /etc/my.cnf __mysql_packages: - mysql From a8c5c3b6725085556366b54830f904053ad3bf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Bold=C3=BA?= Date: Tue, 2 Jun 2015 15:53:37 +0200 Subject: [PATCH 2/5] remove pidfile shortcut --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index caedf253..c966bcb1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,7 +23,7 @@ mysql_enablerepo: "" mysql_port: "3306" mysql_bind_address: '0.0.0.0' mysql_datadir: /var/lib/mysql -__mysql_pid_file: /var/run/mysqld/mysqld.pid +mysql_pid_file: /var/run/mysqld/mysqld.pid # Slow query log settings. mysql_slow_query_log_enabled: no From 1b1a131dc659ca5e6c0b522640016c81ac1ebb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Bold=C3=BA?= Date: Tue, 2 Jun 2015 16:25:23 +0200 Subject: [PATCH 3/5] mysql_daemon fact, README example --- README.md | 15 +++++++++++++++ tasks/main.yml | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index dfa8814d..ba71f9e8 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,21 @@ None. password: similarly-secure-password priv: "example_db.*:ALL" + +## Mariadb usage + + 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 + ## License MIT / BSD diff --git a/tasks/main.yml b/tasks/main.yml index 271393a4..d8ad3a89 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,6 +8,11 @@ mysql_packages: "{{ __mysql_packages | list }}" when: mysql_packages is not defined +- name: Define mysql_daemon. + set_fact: + mysql_daemon: "{{ __mysql_daemon }} " + when: mysql_daemon is not defined + # Setup/install tasks. - include: setup-RedHat.yml when: ansible_os_family == 'RedHat' From 07afd0753d0ef532804b72cff6a9d86d468819b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Bold=C3=BA?= Date: Thu, 18 Jun 2015 18:12:53 +0200 Subject: [PATCH 4/5] Ubuntu14 example --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ba71f9e8..321d3b9f 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ None. ## Mariadb usage +For CentOS 7: + mysql_packages: - mariadb - mariadb-server @@ -121,6 +123,13 @@ None. 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 From 733badadfcb511180d6286449e5e8b1a78298f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Bold=C3=BA?= Date: Thu, 18 Jun 2015 18:14:08 +0200 Subject: [PATCH 5/5] some typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 321d3b9f..95360ca9 100644 --- a/README.md +++ b/README.md @@ -123,12 +123,12 @@ For CentOS 7: mysql_syslog_tag: mariadb mysql_pid_file: /var/run/mariadb/mariadb.pid -For Ubuntu 14.04 : +For Ubuntu 14.04: mysql_packages: - mariadb-client - mariadb-server - - python-mysqldb + - python-mysqldb ## License