Install the MySQL client and/or server on Linux and MacOS.
Table of Contents
- General notes
- Contributing to this repo
- Available states
See the full SaltStack Formulas installation and usage instructions.
If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.
If you want to use this formula, please pay attention to the
FORMULA file and/or
which contains the currently released version. This formula is versioned according to Semantic Versioning.
See Formula Versioning Section for more details.
Commit message formatting is significant!!
Please see How to contribute for more details.
Meta-state including all server packages in correct order. This meta-state does not include
Install "MySQL Community Server", "MySQL Workbench", and other related mysql products on MacOS (and create Desktop shortcuts).
Remove "MySQL Community Server", "MySQL Workbench", and any other enabled products from MacOS.
Install the MySQL client package on Linux.
Install the MySQL server package and start the service.
Debian OS family supports setting MySQL root password during install via debconf.
If no root password is provided in the pillar, a random one will
be created. Because Hydrogen doesn't have easy access to a random
function (test.rand_str isn't introduced until Helium), instead,
we use the not-at-all random
grains.server_id. As this is
cryptographically insecure, future formula versions should use the
Enforces a root password to be set.
Ensure that the MySQL service is not running.
Create and manage MySQL databases.
Install mysql python bindings.
Create and manage MySQL database users with definable GRANT privileges.
The state accepts MySQL hashed passwords or clear text. Hashed password have priority.
See the salt.states.mysql_user docs for additional information on configuring hashed passwords.
Make sure to quote the passwords in the pillar so YAML doesn't throw an exception.
Do not use this state if your MySQL instance has a database in use called
If you do, it will be irrevocably removed!
Remove the database called
test, normally created as part of a default
MySQL installation. This state is not included as part of the meta-state
above as this name may conflict with a real database.
Install the MySQL development libraries and header files.
Note that this state is not installed by the mysql meta-state unless you set your pillar data accordingly.
Add the official MySQL 5.7 repository.
Note that this state currently only supports MySQL 5.7 for RHEL systems. Debian and Suse support to be added. Also need to add the option to allow selection of MySQL version (5.6 and 5.5 repos are added but disabled) and changed enabled repository accordingly.
Manage the MySQL configuration.
There are currently two common ways to configure MySQL, a monolithic configuration file or a configuration directory with configuration files per component. By default this state will use a configuration directory for CentOS and Fedora, and a monolithic configuration file for all other supported OSes.
Whether the configuration directory is used or not depends on whether mysql.config_directory is defined in the pillar. If it is present it will pick the configuration from individual component keys (mysql.server, mysql.galera, mysql.libraries, etc) with optional global configuration from mysql.global. The monolithic configuration, however, is defined separately in mysql.config.
Linux testing is done with
$ gem install bundler $ bundle install $ bin/kitchen test [platform]
[platform] is the platform name defined in
Creates the docker instance and runs the
mysql main state, ready for testing.
inspec tests on the actual instance.
Removes the docker instance.
Runs all of the stages above in one go: i.e.
Gives you SSH access to the instance for manual testing.