Open tuxmaster5000 opened 1 year ago
Does your function return a Sensitive
already (or could it be altered to)? I suspect the issue is you wrapping the Deferred
in Sensitive
. Also can you confirm your Puppet version?
I use puppet 8. The function will return an String. Without the Sensitive option, it will fails with:
Error: Could not set 'present' on ensure: invalid byte sequence in UTF-8 (file: /etc/puppetlabs/code/environments/production/modules/mysql/manifests/db.pp, line: 101)
Error: Could not set 'present' on ensure: invalid byte sequence in UTF-8 (file: /etc/puppetlabs/code/environments/production/modules/mysql/manifests/db.pp, line: 101)
Wrapped exception:
invalid byte sequence in UTF-8
For the char set utf8mb4 was chosen.
Looking at the current version of the code, it looks like this should have worked. Can you confirm the module version you're using and also re-run with --debug --trace
.
├── puppetlabs-mysql (v15.0.0) here the debug output: puppet.zip
Looks like the database creation itself is failing before anything to do with the user's password.
I don't get the exact same error (which is probably mysql/mariadb version dependent), but I suspect the one I get highlights the problem.
COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4'
Try...
mysql::db { 'my_db':
charset => 'utf8mb4',
collate => 'utf8mb4_0900_ai_ci', # Or possibly 'utf8mb4_unicode_ci' depending on your mysql variant/version
}
Reading https://mariadb.com/kb/en/supported-character-sets-and-collations will shown that utf8mb4_general_ci will be the right. I have tried charset =>utf8mb4 with collate=>utf8mb4_general_ci. But the error are the same. I am using MariaDB 10.11.4. Here the last log: debug.zip On the command line, I can execute the last command before the error:
mysql -NBe "SHOW GRANTS FOR 'PUBLIC'@'';" ERROR 1141 (42000) at line 1: Für Benutzer 'PUBLIC' auf Host '%' gibt es keine solche Berechtigung
The mysql::db resource needs an password, but it can't received by the Deferred function of puppet. Sample code:
The use of it fails with: