Takashi Kajinami 9c2d58221c Ubuntu: Use utf8mb3_general_ci collate in MySQL
Currently idempotency in Ubuntu is broken because of the below change
detected in collate in MySQL.

```
/Stage[main]/Keystone::Db::Mysql/Openstacklib::Db::Mysql[keystone]/
Mysql_database[keystone]/collate: collate changed 'utf8mb3_general_ci'
to 'utf8_general_ci'
```

Similarly to what we observed in the past about charset[1], it seems
MySQL in Ubuntu is automatically converting the collate value and that
is causing the "unexpected" change detected in the 2nd puppet run.

This fixes the idempotency by using utf8mb3_general_ci in Ubuntu to
avoid the mismatch caused by internal translation.

[1] 085d3569021441810c1dff7c8f4396003c690805

Change-Id: I56f31397669d3d7b08aa2e9808947141e003ab0b
2022-08-02 08:20:24 +09:00

31 lines
1.1 KiB
Puppet

class openstack_integration::params {
case $::osfamily {
'RedHat': {
$ca_bundle_cert_path = '/etc/ssl/certs/ca-bundle.crt'
$cert_path = '/etc/pki/ca-trust/source/anchors/puppet_openstack.pem'
$update_ca_certs_cmd = '/usr/bin/update-ca-trust force-enable && /usr/bin/update-ca-trust extract'
$mysql_charset = 'utf8'
$mysql_collate = 'utf8_general_ci'
}
'Debian': {
$ca_bundle_cert_path = '/etc/ssl/certs/puppet_openstack.pem'
$cert_path = '/usr/local/share/ca-certificates/puppet_openstack.crt'
$update_ca_certs_cmd = '/usr/sbin/update-ca-certificates -f'
if $::operatingsystem == 'Debian' {
$mysql_charset = 'utf8'
$mysql_collate = 'utf8_general_ci'
} else {
# TODO(tkajinam): This is to fix the gate quickly. We should revisit
# this later. utf8mb4 would be the preferred option
$mysql_charset = 'utf8mb3'
$mysql_collate = 'utf8mb3_general_ci'
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")
}
}
}