Add remove test database state

Conflicts:
	README.rst

Conflicts:
	README.rst
This commit is contained in:
David\ Beitey 2014-10-10 17:46:45 +10:00
parent 76390e2f6b
commit 4e40bc2c51
2 changed files with 28 additions and 0 deletions

View file

@ -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
=================================

View 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