summaryrefslogtreecommitdiffstats
path: root/roles/common-SQL
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2017-07-29 13:45:26 +0200
committerGuilhem Moulin <guilhem@fripost.org>2017-07-29 13:45:32 +0200
commitd8d07afe49e69114f8deb807031bec71a327d3ae (patch)
treef607b4446a7a8d68dc7137230ca9a515a1bac519 /roles/common-SQL
parentd0294df197362ee61a65f0b5931b4e760c1efc2c (diff)
Use MariaDB as default MySQL flavor.
Diffstat (limited to 'roles/common-SQL')
-rw-r--r--roles/common-SQL/files/etc/mysql/my.cnf1
-rw-r--r--roles/common-SQL/tasks/main.yml14
2 files changed, 4 insertions, 11 deletions
diff --git a/roles/common-SQL/files/etc/mysql/my.cnf b/roles/common-SQL/files/etc/mysql/my.cnf
index 6caeb64..e1dff58 100644
--- a/roles/common-SQL/files/etc/mysql/my.cnf
+++ b/roles/common-SQL/files/etc/mysql/my.cnf
@@ -18,41 +18,40 @@
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
-plugin-load = auth_socket=auth_socket.so
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
character_set_server = utf8
collation_server = utf8_unicode_ci
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
skip-networking
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
diff --git a/roles/common-SQL/tasks/main.yml b/roles/common-SQL/tasks/main.yml
index 9064a68..73b6878 100644
--- a/roles/common-SQL/tasks/main.yml
+++ b/roles/common-SQL/tasks/main.yml
@@ -1,51 +1,45 @@
-# XXX If #742046 gets fixed, we should preseed mysql-server to use
-# auth_socket as auth_plugin once the fix enters stable.
-- name: Install MySQL
+- name: Install MariaDB
apt: pkg={{ item }}
with_items:
- # XXX: In non-interactive mode apt-get doesn't put a password on
- # MySQL's root user; we fix that on the next task, but an intruder
- # could exploit the race condition and for instance create dummy
- # users.
- - mysql-common
- - mysql-server
+ - mariadb-common
+ - mariadb-server
- python-mysqldb
# for the 'mysql_' munin plugin
- libcache-cache-perl
- name: Copy MySQL's configuration
copy: src=etc/mysql/my.cnf
dest=/etc/mysql/my.cnf
owner=root group=root
mode=0644
register: r
notify:
- Restart MySQL
# We need to restart now and load the relevant authplugin before we
# connect to the database.
- meta: flush_handlers
# XXX Dirty fix for #742046
- name: Force root to use UNIX permissions
- mysql_user2: name=root password= auth_plugin=auth_socket
+ mysql_user2: name=root password= auth_plugin=unix_socket soname=auth_socket.so
state=present
- name: Disallow anonymous and TCP/IP root login
mysql_user2: name={{ item.name|default('') }} host={{ item.host }}
state=absent
with_items:
- { host: '{{ inventory_hostname_short }}' }
- { host: 'localhost' }
- { host: '127.0.0.1'}
- { host: '::1'}
- { name: root, host: '{{ inventory_hostname_short }}' }
- { name: root, host: '127.0.0.1'}
- { name: root, host: '::1'}
- name: Start MySQL
service: name=mysql state=started
- name: Install 'mysql_' Munin wildcard plugin
file: src=/usr/share/munin/plugins/mysql_