Add support for Oracle Linux 7 and later.
Most of the changes revolves around using MySQL rather than MariaDB,
plus enabling the addon repos on public-yum.oracle.com.
The patch just touch the areas where there is a divergence between the
Fedora and Oracle distributions and in all other cases the is_fedora
will result in the correct decision to be made and left as is.
Collapsed the is_suse and is_oraclelinux into a single check in
configure_database_mysql and cleanup_database_mysql
Added Oracle Linux to MAINTAINERS.rst
Rather than duplicating most of the Redhat version check code, added
a check in the block to do the determination if it is Oracle Linux
Change-Id: I5f1f15106329eec67aa008b17847fa44863f243f
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 70073c4..dabd7d0 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -16,7 +16,7 @@
# Linux distros, thank you for being incredibly consistent
MYSQL=mysql
-if is_fedora; then
+if is_fedora && ! is_oraclelinux; then
MYSQL=mariadb
fi
@@ -32,12 +32,12 @@
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
return
+ elif is_suse || is_oraclelinux; then
+ uninstall_package mysql-community-server
+ sudo rm -rf /var/lib/mysql
elif is_fedora; then
uninstall_package mariadb-server
sudo rm -rf /var/lib/mysql
- elif is_suse; then
- uninstall_package mysql-community-server
- sudo rm -rf /var/lib/mysql
else
return
fi
@@ -56,12 +56,12 @@
if is_ubuntu; then
my_conf=/etc/mysql/my.cnf
mysql=mysql
+ elif is_suse || is_oraclelinux; then
+ my_conf=/etc/my.cnf
+ mysql=mysql
elif is_fedora; then
mysql=mariadb
my_conf=/etc/my.cnf
- elif is_suse; then
- my_conf=/etc/my.cnf
- mysql=mysql
else
exit_distro_not_supported "mysql configuration"
fi
@@ -140,14 +140,14 @@
chmod 0600 $HOME/.my.cnf
fi
# Install mysql-server
- if is_fedora; then
- install_package mariadb-server
- elif is_ubuntu; then
- install_package mysql-server
- elif is_suse; then
+ if is_suse || is_oraclelinux; then
if ! is_package_installed mariadb; then
install_package mysql-community-server
fi
+ elif is_fedora; then
+ install_package mariadb-server
+ elif is_ubuntu; then
+ install_package mysql-server
else
exit_distro_not_supported "mysql installation"
fi