Open daks opened 2 years ago
fyi (not sure why) it happens at least on Debian 11, but not on openSUSE Leap. Ah, on Leap the error is shown later, when you try to use client:
mariadb -V
mariadb: Can't read dir of '/etc/my.cnf.d' (Errcode: 2 "No such file or directory")
I just hit this issue and did some work investigating it. It turns out a simple workaround exists:
# Pillar data.
mysql:
config_directory: /etc/mysql
The configuration directory is only created if the config_directory
entry is present in the pillar data:
The problem comes from the absence of a default value for Debian:
Unlike CentOS and Fedora (lines 19 and 35):
I have only tested this workaround on Debian 11 so far.
Your setup
Formula commit hash / release tag
master version b9b8792a1e9422ae5c9d92636b0c1c61014f4dd0
Versions reports (master & minion)
Using Kitchen setup from the formula
Pillar / config used
No pillar (
test/salt/pillar/mysql.sls
empty) Kitchen.yml changed to callmysql.client
state instead of the meta-statemysql
Bug details
Describe the bug
When running state
mysql.client
it executesmysql.config
which returns an Error if no pillar is providedSteps to reproduce the bug
You can see here the code https://github.com/daks/mysql-formula/tree/bug-client and the CI pipeline https://gitlab.com/daks/mysql-formula/-/pipelines/516218792
Expected behaviour
I expect this state to at minima install client packages. I don't necesary expect it to manage configuration but if it needs to be done, it should executed without errors
Attempts to fix the bug
None at the moment. I think the bug comes from one of the "if" in the state mysql.config
Additional context