Improve MySQL Governor's MySQL version installation/verification
Currently there doesn't seem to be an easy way to detect if the MySQL version currently installed is the one provided by MySQL Governor and if it's the one that has been chosen when using "db-select-mysql --mysql-version=mariadb55".
Would it be possible to add an option to either mysqlgovernor.py or db-select-mysql that would allow a server admin to check what's the current state of MySQL installation on the server in the context of MySQL Governor?
For instance, cPanel provides something similar for various services it manages:
/scripts/setupmailserver --current
Current mailserver type: dovecot
Current storage format: maildir
/scripts/setupftpserver --current
Current FTP server type: pure-ftpd
/usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: fcgi cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: fcgi
SUEXEC: enabled
RUID2: not installed
What I would suggest is an option that would output something like this:
/usr/share/lve/dbgovernor/db-select-mysql --current
Available MySQL versions: auto mysql50 mysql51 mysql55 mysql56 mariadb55
Currently selected MySQL version: mariadb55
Currently installed MySQL version: auto
/usr/share/lve/dbgovernor/db-select-mysql --check
Currently selected MySQL version (mariadb55) does not match installed version (mysql51). Please run with --install option to install selected version.
(script would exit with code 0 if selected version match installed version and non-zero exit code if there is a mismatch. This will allow the command to be used in scripts easily)
Currently, when trying to detect whether the installed version is the selected one using scripts or automation software (puppet, chef, salt, ansible...) is very hard and error-prone. For instalce I currently use a mix of checking the content of /usr/share/lve/dbgovernor/mysql.type and various 'rpm -qa | grep | grep && if/else, etc, etc...'.
Having a Cloudlinux-provided way to do this would help immensely when automating the deployment of Cloudlinux servers /w MySQL Governor