Current default version for FreeBSD is MySQL 5.7, also python 2.x is
deprecated and should be removed any time soon.
FreeBSD uses the `mysql_install_db` which generates a temporary root
password upon the first start. To the best of my understanding I haven't
seen any code in the formula that handles this method. So I added
a FreeBSD-scpecific block for initialization. While here, create
`/var/log/mysql` without which the server won't start if it doesn't
exist.
Co-authored-by: Geraud CONTINSOUZAS <geraud.continsouzas@skazy.nc>
```bash
Examining mysql/server.sls of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
mysql/server.sls:119
- creates: {{ mysql_datadir}}/mysql/
[206] Jinja variables should have spaces before and after: {{ var_name }}
mysql/server.sls:141
- creates: {{ mysql_datadir}}/mysql/
```
This fixes https://github.com/saltstack-formulas/mysql-formula/issues/157
* Avoid failures on first run with a salt_user defined
Add a dependency on sls: mysql.salt-user to ensure MySQL users
(especially the salt_user) get created early enough - without that,
parts of the first run will fail (but a second run works).
mysql.server formula failed on gentoo because of hard-coded pid-file (pid_file is not detected as declared for gentoo defaults.yaml because the variable name for the pid-file is hard-coded in the init.d script installed by standard dev-db/mysql ebuild as pid-file (not pid_file)).
mysql.server formula also failed because it was missing the step. This commit adds this as an alternative mysql_initialize step for the gentoo os_family.
Some distros set the environment variable for the temp directory to
/tmp/$USER which is owned by $USER mode 700. This prevents the
mysql user from being able to access the temporary files it needs.
the config file update depends on the parent directory /etc/mysql being present, which is created as part of the mysql-server package installation. therefore, the mysqld state is split up for debian environments into the package installation and the mysqld configuration. this allows to set the pkg installation as a requirement for the config file management and to set the config file management as a requirement for the mysqld service management