voxpupuli / puppet-zabbix

Puppet module for creating and maintaining zabbix components with puppet.

Home Page:https://forge.puppet.com/puppet/zabbix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mysql charset (utf8) and collate (utf8_bin) not idempotent

xchotard-talentsoft opened this issue · comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.27.1-1focal
  • Ruby: 2.5.9p229
  • Distribution: Ubuntu 20.04
  • Module version: v9.2.0

How to reproduce (e.g Puppet code you use)

class { 'apache':
  mpm_module => 'prefork',
}

class { 'apache::mod::php': }

class { 'mysql::server': }

class { 'zabbix':
  zabbix_url    => 'zabbix.example.com',
  database_type => 'mysql',
}

What are you seeing

At each Puppet agent execution, the following changes are reported:

Notice: /Stage[main]/Zabbix::Database/Mysql::Db[zabbix_server]/Mysql_database[zabbix_server]/charset: charset changed 'utf8mb3' to 'utf8' (corrective)
Notice: /Stage[main]/Zabbix::Database/Mysql::Db[zabbix_server]/Mysql_database[zabbix_server]/collate: collate changed 'utf8mb3_bin' to 'utf8_bin' (corrective)

What behaviour did you expect instead

The charset/collate changes should not be corrected at each run.

Output log

Any additional information you'd like to impart

This issue is very similar to: https://tickets.puppetlabs.com/browse/IAC-1612

As a workaround, it is possible to replace utf8 by utf8mb4 and utf8_bin by utf8mb4_unicode_ci in manifests/params.pp:

-  $server_database_charset                  = 'utf8'
-  $server_database_collate                  = 'utf8_bin'
+  $server_database_charset                  = 'utf8mb4'
+  $server_database_collate                  = 'utf8mb4_unicode_ci'

Being able to pass charset and collate parameters to the zabbix::server and zabbix::proxy classes would also be a nice addition.

This behavior depends on MySQL-Server version.

Can we get a 9.2.1 release for this fix 🙏