mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-15 17:20:25 +00:00
Add remove test database state
Conflicts: README.rst Conflicts: README.rst
This commit is contained in:
parent
76390e2f6b
commit
4e40bc2c51
2 changed files with 28 additions and 0 deletions
14
README.rst
14
README.rst
|
@ -20,6 +20,9 @@ Available states
|
|||
|
||||
Meta-state that includes all server packages in the correct order.
|
||||
|
||||
This meta-state does **not** include ``mysql.remove_test_database``; see
|
||||
below for details.
|
||||
|
||||
``mysql.client``
|
||||
----------------
|
||||
|
||||
|
@ -67,6 +70,17 @@ priority.
|
|||
|
||||
Make sure to **quote the passwords** in the pillar so YAML doesn't throw an exception.
|
||||
|
||||
``mysql.remove_test_database``
|
||||
------------------------------
|
||||
|
||||
.. warning::
|
||||
|
||||
Do not use this state if your MySQL instance has a database in use called ``test``.
|
||||
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.
|
||||
|
||||
Updating the supported parameters
|
||||
=================================
|
||||
|
|
14
mysql/remove_test_database.sls
Normal file
14
mysql/remove_test_database.sls
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
|
||||
|
||||
include:
|
||||
- mysql.python
|
||||
|
||||
mysql remove test database:
|
||||
mysql_database.absent:
|
||||
- name: test
|
||||
- host: localhost
|
||||
- connection_user: root
|
||||
{% if mysql_root_pass %}
|
||||
- connection_pass: '{{ mysql_root_pass }}'
|
||||
{% endif %}
|
||||
- connection_charset: utf8
|
Loading…
Add table
Reference in a new issue