bertvv / ansible-role-mariadb

Install MariaDB on RHEL/CentOS 7 or Fedora.
https://galaxy.ansible.com/bertvv/mariadb/
Other
145 stars 108 forks source link

Running the role in CentOS 8 fails #30

Closed stevesaliman closed 4 years ago

stevesaliman commented 5 years ago

CentOS 8 has made some changes that break this role. I've run into 3 problems so far:

  1. For some reason, MariaDB doesn't install when the CentOS AppStream repo is enabled - yum can't seem to work around name conflicts. This can be solved by disabling the AppStream repo in the yum task, but that leads to problem 2....

  2. Certain dependencies live in the AppStream repo and won't be found when the repo is disabled.

  3. The MySQL-python package is now called python3-PyMySQL.

I've worked around this issue in my fork of the role with the following:

  1. I created a CentOS.yml variable file that will be read in when running under CentOS.

  2. I've added 2 new variables to this file, mariadb_disable_repos that defines repositories that need to be disabled when the yum task to install the DB runs, and mariadb_prerequisite_packages that defines a list of packages that need to be installed first, before we try to install the database itself. I've put boost-program-options and python3-PyMySQL in that list

  3. I added a yum task to install.yml to install the prerequisite packages, if any are defined, and changed the existing yum task to disable repos in the mariadb_disable_repos string. If it isn't defined, I use an empty string here, which appears to work fine.

This implementation should work fine in RHEL and Fedora, as well as CentOS 8. I haven't done a pull request because my changes would break CentOS 7, but it might be a good place to start to get this working.