The indentation in servers.sls was unclear and made following the
control flow much harder.
Fix that by correctly indenting.
Drive-By: Change {% to {%- no-line-break opening tags for variable logic
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/
```
I've added support for the official mysql 8.0 packages and the relevant repositories.
Package names are mysql-community-server and mysql-community-client.
I know the repo setting breaks convention a bit but it is compulsory so I'm not sure how else to properly include it.
This change requires the salt pull request I created https://github.com/saltstack/salt/pull/51240 to be able to grant users.
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.