Update docs for module and states

This commit is contained in:
Wayne Werner 2022-02-24 12:00:53 -06:00 committed by Daniel Wozniak
parent 524b99cfcc
commit 0c7041ac43
3 changed files with 108 additions and 125 deletions

View file

@ -161,6 +161,11 @@ def db_list(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -236,6 +241,11 @@ def db_exists(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -306,6 +316,11 @@ def db_remove(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -345,29 +360,6 @@ def version(
"""
Get MongoDB instance version.
user
The user to authenticate with, if necessary.
password
The password to authenticate with, if necessary.
host
The host running MongoDB.
port
The port MongoDB is listening on.
database
The database to get the buildInfo version from, if not "admin".
authdb
The database to authenticate against, if not "admin".
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
.. versionadded:: 3005
user
The user to connect to MongoDB as. Default is None.
@ -388,6 +380,11 @@ def version(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -452,6 +449,11 @@ def user_find(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -510,6 +512,11 @@ def user_list(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -581,6 +588,11 @@ def user_exists(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -649,6 +661,11 @@ def user_create(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -713,6 +730,11 @@ def user_remove(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -778,31 +800,12 @@ def user_roles_exists(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
.. versionadded:: 3005
.. versionadded:: 3006
name
The name of the user to check for the specified roles.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
roles
The roles to check are associated with the specified user.
database
The database to check has the specified roles for the specified user.
user
The user to connect to MongoDB as. Default is None.
password
The password to use to connect to MongoDB as. Default is None.
host
The host where MongoDB is running. Default is None.
port
The host where MongoDB is running. Default is None.
authdb
The MongoDB database to use for authentication. Default is None.
.. versionadded:: 3006
CLI Examples:
@ -885,34 +888,10 @@ def user_grant_roles(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
.. versionadded:: 3005
.. versionadded:: 3006
name
The user to grant the specified roles to.
roles
The roles to grant to the specified user.
database
The database to great the roles against for the specified user.
user
The user to connect to MongoDB as. Default is None.
password
The password to use to connect to MongoDB as. Default is None.
host
The host where MongoDB is running. Default is None.
port
The host where MongoDB is running. Default is None.
authdb
The MongoDB database to use for authentication. Default is None.
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
@ -994,31 +973,10 @@ def user_revoke_roles(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
.. versionadded:: 3005
.. versionadded:: 3006
user
The user to connect to MongoDB as. Default is None.
roles
The roles to revoke from the specified user.
database
The database to revoke the roles from for the specified user.
password
The password to use to connect to MongoDB as. Default is None.
host
The host where MongoDB is running. Default is None.
port
The host where MongoDB is running. Default is None.
authdb
The MongoDB database to use for authentication. Default is None.
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
@ -1093,6 +1051,9 @@ def collection_create(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
CLI Example:
.. code-block:: bash
@ -1150,6 +1111,12 @@ def collection_drop(
authdb
The MongoDB database to use for authentication. Default is None.
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
CLI Example:
.. code-block:: bash
@ -1206,6 +1173,9 @@ def collections_list(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
CLI Example:
.. code-block:: bash
@ -1269,31 +1239,10 @@ def insert(
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
.. versionadded:: 3005
.. versionadded:: 3006
objects
The objects to insert into the collection, should be provided as a list.
collection
The collection to insert the objects into.
user
The user to connect to MongoDB as. Default is None.
password
The password to use to connect to MongoDB as. Default is None.
host
The host where MongoDB is running. Default is None.
port
The host where MongoDB is running. Default is None.
authdb
The MongoDB database to use for authentication. Default is None.
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
@ -1376,6 +1325,11 @@ def update_one(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -1478,6 +1432,11 @@ def find(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash
@ -1563,6 +1522,11 @@ def remove(
.. versionadded:: 3006
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3006
CLI Example:
.. code-block:: bash

View file

@ -26,7 +26,7 @@ def absent(
port=None,
authdb=None,
ssl=None,
verify_ssl=None,
verify_ssl=True,
):
"""
Ensure that the named database is absent. Note that creation doesn't make
@ -51,9 +51,14 @@ def absent(
The database in which to authenticate
ssl
Whether or not to connect to MongoDB over SSL. Default ``False``.
Whether or not to use SSL to connect to mongodb. Default False.
.. versionadded:: 3005
.. versionadded:: 3005.0
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3005.0
"""
ret = {"name": name, "changes": {}, "result": True, "comment": ""}

View file

@ -26,7 +26,7 @@ def present(
authdb=None,
roles=None,
ssl=False,
verify_ssl=None,
verify_ssl=True,
):
"""
Ensure that the user is present with the specified properties
@ -64,6 +64,13 @@ def present(
ssl
Whether or not to use SSL to connect to mongodb. Default False.
.. versionadded:: 3005.0
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3005.0
Example:
.. code-block:: yaml
@ -230,6 +237,13 @@ def absent(
ssl
Whether or not to use SSL to connect to mongodb. Default False.
.. versionadded:: 3005.0
verify_ssl
Whether or not to verify the server cert when connecting. Default True.
.. versionadded:: 3005.0
"""
ret = {"name": name, "changes": {}, "result": True, "comment": ""}