Add Xenial support for MariaDB

Add the elements for building the MariaDB 10.1 guest image on Xenial.

A change was required to the service_candidates to allow for the
selection of the systemd unit file (mariadb.service) instead of the
old upstart script.

Change-Id: Iee0548e109f26c675b1410b6457b9e63ada9c0db
This commit is contained in:
Doug Shelley 2016-12-05 16:53:42 +00:00
parent 823c1c7a58
commit c0c0249434
4 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1 @@
ubuntu-mariadb

View File

@ -0,0 +1,39 @@
#!/bin/sh
# CONTEXT: GUEST during CONSTRUCTION as ROOT
# PURPOSE: Install controller base required packages
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
# NOTE(vkmc): Using MariaDB repositories is required
# https://mariadb.com/kb/en/mariadb/installing-mariadb-deb-files/
apt-get -y install software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu xenial main'
# Pin MariaDB repository
sudo echo -e "Package: *\nPin: origin ftp.osuosl.org\nPin-Priority: 1000" > /etc/apt/preferences.d/mariadb.pref
apt-get -y update
apt-get -y install socat percona-xtrabackup
apt-get -y install libmariadbclient18 mariadb-server
cat >/etc/mysql/conf.d/no_perf_schema.cnf <<_EOF_
[mysqld]
performance_schema = off
_EOF_
mv /etc/mysql/my.cnf.fallback /etc/mysql/my.cnf
chown mysql:mysql /etc/mysql/my.cnf
cat >/etc/mysql/my.cnf <<_EOF_
[mysql]
!includedir /etc/mysql/conf.d/
_EOF_
rm /etc/init.d/mysql
systemctl daemon-reload
systemctl enable mariadb

View File

@ -37,7 +37,7 @@ class MariaDBApp(galera_service.GaleraApp):
def service_candidates(self):
service_candidates = super(MariaDBApp, self).service_candidates
return {
operating_system.DEBIAN: service_candidates,
operating_system.DEBIAN: ["mariadb"] + service_candidates,
operating_system.REDHAT: ["mariadb"],
operating_system.SUSE: service_candidates
}[self.OS]