Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql as package_name mysql-server, the module try to install mariaDB packages. #1620

Open
hoshang82 opened this issue Feb 22, 2024 · 1 comment

Comments

@hoshang82
Copy link

hoshang82 commented Feb 22, 2024

I install mysql server;

class { 'mysql::server':
    package_name  => 'mysql-server',
    service_name  => 'mysql',
    #package_ensure => 'mysql-server-8.0',
    root_password           => "myAwsomePassword",
    create_root_my_cnf     => true,
    remove_default_accounts => true,
    #restart                 => true,  
  }

On terminal:

dpkg -l | grep mysql*

ii  libdbd-mysql-perl:amd64              4.050-5ubuntu0.22.04.1                     amd64        Perl5 database interface to the MariaDB/MySQL database
ii  libmysqlclient21:amd64               8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database client library
ii  mysql-client-8.0                     8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database client binaries
ii  mysql-client-core-8.0                8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database core client binaries
ii  mysql-common                         5.8+1.0.8                                  all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                         8.0.36-0ubuntu0.22.04.1                    all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-8.0                     8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-8.0                8.0.

and for mariadb there is no output, so far so good.
# dpkg -l | grep maria*

as far I want to create database with below section:

mysql::db { 'mydb':
   user     => 'myuser',
   password => 'mypass',
   host     => 'localhost',
   grant    => ['SELECT', 'UPDATE'],
 }

to check whats happens

dpkg -l | grep mysql*

ii  libdbd-mysql-perl:amd64              4.050-5ubuntu0.22.04.1                     amd64        Perl5 database interface to the MariaDB/MySQL database
ii  libmysqlclient21:amd64               8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database client library
ii  mysql-common                         5.8+1.0.8                                  all          MySQL database common files, e.g. /etc/mysql/my.cnf
rc  mysql-server-8.0                     8.0.36-0ubuntu0.22.04.1                    amd64        MySQL database server binaries and system database setup

for mariadb

dpkg -l | grep maria*

ii  libmariadb3:amd64                    1:10.6.16-0ubuntu0.22.04.1                 amd64        MariaDB database client library
ii  mariadb-client                       1:10.6.16-0ubuntu0.22.04.1                 all          MariaDB database client (metapackage depending on the latest version)
ii  mariadb-client-10.6                  1:10.6.16-0ubuntu0.22.04.1                 amd64        MariaDB database client binaries
ii  mariadb-client-core-10.6             1:10.6.16-0ubuntu0.22.04.1                 amd64        MariaDB database core client binaries
ii  mariadb-common                       1:10.6.16-0ubuntu0.22.04.1                 all          MariaDB common configuration files

When I add the create database section, its install mariaDB client I dont know why!!!

I can see here :https://github.com/puppetlabs/puppetlabs-mysql/blob/main/manifests/params.pp

in the switch case it decide for debian in my case uUbuntu 22.04 for mariadb as provider but why?

    'Debian': {
      if $facts['os']['name'] == 'Debian' or $facts['os']['name'] == 'Raspbian' or
      ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0) {
        $provider = 'mariadb'
      } else {
        $provider = 'mysql'
      }
      if $provider == 'mariadb' {
        $client_package_name     = 'mariadb-client'
        $server_package_name     = 'mariadb-server'
        $server_service_name     = 'mariadb'
        $client_dev_package_name = 'libmariadbclient-dev'
        $daemon_dev_package_name = 'libmariadbd-dev'
      } else {
        $client_package_name     = 'mysql-client'
        $server_package_name     = 'mysql-server'
        $server_service_name     = 'mysql'
        $client_dev_package_name = 'libmysqlclient-dev'
        $daemon_dev_package_name = 'libmysqld-dev'
      }
@Jimadine
Copy link

Based off of this comment, can you try adding:

  class {'mysql::client':
    package_name   => 'mysql-client',
  }

I'm not sure if it's relevant to the problem you're seeing, but you might also add:

  class { 'mysql::bindings':
    client_dev_package_name => 'libmysqlclient',
    daemon_dev_package_name => 'libmysqld-dev',
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants