puppetlabs/puppetlabs-mysql

Existing mysql installations will fail with 13.0.0 change for Ubuntu 20.04

PresGas opened this issue · 2 comments

Describe the Bug

On updating the Puppet module with an existing installation of mysql rather than mariadb, puppet will run with errors attempting to assume mariadb. Our particular case has:

mysql-client-8.0/focal-updates,focal-security,now 8.0.30-0ubuntu0.20.04.2 amd64 [installed,automatic]
mysql-client-core-8.0/focal-updates,focal-security,now 8.0.30-0ubuntu0.20.04.2 amd64 [installed,automatic]
mysql-common/focal,focal,now 5.8+1.0.5ubuntu2 all [installed]
mysql-server/focal-updates,focal-updates,focal-security,focal-security,now 8.0.30-0ubuntu0.20.04.2 all [installed]
mysql-server-8.0/focal-updates,focal-security,now 8.0.30-0ubuntu0.20.04.2 amd64 [installed,automatic]
mysql-server-core-8.0/focal-updates,focal-security,now 8.0.30-0ubuntu0.20.04.2 amd64 [installed,automatic]

Current error on Puppet execution:

Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install mariadb-server' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.34-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Error: /Stage[main]/Mysql::Server::Install/Package[mysql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install mariadb-server' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.34-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages. (corrective)

Suspect change was here?
#1449

Expected Behavior

If an Ubu 20.04 machine already has mysql installed, should continue with that.

Steps to Reproduce

Update Puppetfile with 13.0.0 of puppetlabs-mysql module. Was using 12.0.3.

Environment

  • Version 2019.8
  • Platform Ubuntu 20.04

@PresGas Taking a look at this, my best guess is that your issue is caused by the fact that the module assumes mariadb on ubuntu 20.04 and above as to my knowledge that is what is installed by default. To get around this you must manually set the automated variables that decide this.

You should only need to manually set the following variables:

  • package_name in client.pp must be set to mysql-client
  • package_name again in server.pp must also be set to mysql-client
  • sevice_name also in server.pp must be set to mysql
  • client_dev_package_name in bindings.pp must be set to libmysqlclient
  • daemon_dev_package_name in bindings.pp must be set to libmysqld-dev

@PresGas Going to close this as a solution has been given. Feel free to reopen if your issue persists.