puppetlabs / puppetlabs-mysql

MySQL Puppet Module / Manifests + Types & Providers
Apache License 2.0
380 stars 790 forks source link

mysql_login_path fails when running mysql_config_editor for non root user #1614

Open jgrammen-agilitypr opened 7 months ago

jgrammen-agilitypr commented 7 months ago

Describe the Bug

When setting up a mysql_login_path as a non root user the module fails to create the login_path with the error

Debug: Executing with uid=nagios: '/usr/bin/mysql_config_editor print --all'
Error: /Stage[main]/Mm::Mysql_config::Basic_config/Mysql_login_path[nagios]: Could not evaluate: Execution of '/usr/bin/mysql_config_editor print --all' returned 1:

Expected Behavior

creating a login path for any user should result in the .mylogin.cnf file been created and the appropriate login_path existing within the file

Steps to Reproduce

Steps to reproduce the behavior:

  mysql_login_path { 'nagios':
    ensure   => present,
    owner    => 'nagios',
    host     => 'localhost',
    user     => 'nagios',
    password => Sensitive($nagios_pass),
    port     => 3306,
    require  => [User['nagios']],
  }
puppet agent -t

Environment

Additional Context

Add any other context about the problem here.