Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
53238120
Commit
53238120
authored
Aug 06, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #167 from marktheunissen/fix_mysql_docs
Fixing the MySQL docs
parents
f732aa3d
4d7f9fbb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
20 deletions
+36
-20
rst/modules.rst
+36
-20
No files found.
rst/modules.rst
View file @
53238120
...
...
@@ -388,28 +388,35 @@ mysql_db
Add or remove MySQL databases from a remote host.
+--------------------+----------+----------+-----------------------------------------------------------------------------+
Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as
apt-get install python-mysqldb.
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
| parameter | required | default | comments |
+====================+==========+==========+=============================================================================+
+====================+==========+==========
=
+=============================================================================+
| name | yes | | name of the database to add or remove |
+--------------------+----------+-----------+----------------------------------------------------------------------------+
| login_user | no | | user
used to authenticate with
|
+--------------------+----------+-----------+----------------------------------------------------------------------------+
+--------------------+----------+-----------+----------------------------------------------------------------------------
-
+
| login_user | no | | user
name used to authenticate with
|
+--------------------+----------+-----------+----------------------------------------------------------------------------
-
+
| login_password | no | | password used to authenticate with |
+--------------------+----------+-----------+----------------------------------------------------------------------------+
+--------------------+----------+-----------+----------------------------------------------------------------------------
-
+
| login_host | no | localhost | host running the database |
+--------------------+----------+-----------+----------------------------------------------------------------------------+
+--------------------+----------+-----------+----------------------------------------------------------------------------
-
+
| state | no | present | 'absent' or 'present' |
+--------------------+----------+-----------+----------------------------------------------------------------------------+
+--------------------+----------+-----------+----------------------------------------------------------------------------
-
+
| collation | no | | collation mode |
+--------------------+----------+-----------+----------------------------------------------------------------------------
+
+--------------------+----------+-----------+----------------------------------------------------------------------------
-+
| encoding | no | | encoding mode |
+--------------------+----------+-----------+----------------------------------------------------------------------------+
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
Both 'login_password' and 'login_username' are required when you are passing credentials.
If none are present, the module will attempt to read the credentials from ~/.my.cnf, and
finally fall back to using the MySQL default login of 'root' with no password.
Example action from Ansible :doc:`playbooks`::
- name: Create database
action: mysql_db
loginpass=$mysql_root_password
db=bobdata state=present
action: mysql_db db=bobdata state=present
mysql_user
...
...
@@ -417,33 +424,42 @@ mysql_user
Adds or removes a user from a MySQL database.
Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as
apt-get install python-mysqldb.
+--------------------+----------+------------+----------------------------------------------------------------------------+
| parameter | required | default | comments |
+====================+==========+============+============================================================================+
| name | yes | | name of the user (role) to add or remove |
+--------------------+----------+------------+----------------------------------------------------------------------------+
| password |
yes
| | set the user's password |
| password |
no
| | set the user's password |
+--------------------+----------+------------+----------------------------------------------------------------------------+
| db | yes | | name of an existing database to grant user access to |
+--------------------+----------+------------+----------------------------------------------------------------------------+
| login_user | no | | user (role) used to authenticate with |
| login_user | no | | user name used to authenticate with |
+--------------------+----------+------------+----------------------------------------------------------------------------+
| login_password | no | | password used to authenticate with |
+--------------------+----------+------------+----------------------------------------------------------------------------+
| login_host | no | localhost | host running MySQL.
Default (blank) implies localhost
|
| login_host | no | localhost | host running MySQL.
|
+--------------------+----------+------------+----------------------------------------------------------------------------+
| priv | no | | MySQL priv
eledges string
|
| priv | no | | MySQL priv
ileges string in the format: db.table:priv1,priv2
|
+--------------------+----------+------------+----------------------------------------------------------------------------+
| state | no | present | 'absent' or 'present' |
+--------------------+----------+------------+----------------------------------------------------------------------------+
Both 'login_password' and 'login_username' are required when you are passing credentials.
If none are present, the module will attempt to read the credentials from ~/.my.cnf, and
finally fall back to using the MySQL default login of 'root' with no password.
Example privileges string format:
mydb.*:INSERT,UPDATE/anotherdb.*:SELECT/yetanotherdb.*:ALL
Example action from Ansible :doc:`playbooks`::
- name: Create database user
action: mysql_user
loginpass=$mysql_root_password
name=bob passwd=12345 priv=*.*:ALL state=present
action: mysql_user name=bob passwd=12345 priv=*.*:ALL state=present
- name: Ensure no user named 'sally' exists
action: mysql_user login
pass=$mysql_root_password
name=sally state=absent
- name: Ensure no user named 'sally' exists
, also passing in the auth credentials.
action: mysql_user login
_user=root login_password=123456
name=sally state=absent
.. _ohai:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment