summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2020-02-28 08:51:06 +0530
committerGitHub <noreply@github.com>2020-02-28 08:51:06 +0530
commit0cd22abe8c9ac406cdd2f76d488dbf128eb7338a (patch)
tree196d727f089b1d26dfe17605322bc077332f283c /lib
parent8e31a2fe40e918c4eb5f29867e60154cf1ffe2f3 (diff)
downloadansible-0cd22abe8c9ac406cdd2f76d488dbf128eb7338a.tar.gz
mongodb: Fix documentation (#67806)
* Added correct datatypes of parameter * Fixed doc formatting Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/modules/database/mongodb/mongodb_parameter.py57
-rw-r--r--lib/ansible/modules/database/mongodb/mongodb_replicaset.py5
2 files changed, 35 insertions, 27 deletions
diff --git a/lib/ansible/modules/database/mongodb/mongodb_parameter.py b/lib/ansible/modules/database/mongodb/mongodb_parameter.py
index 468250ec6b..05de42b2ea 100644
--- a/lib/ansible/modules/database/mongodb/mongodb_parameter.py
+++ b/lib/ansible/modules/database/mongodb/mongodb_parameter.py
@@ -16,72 +16,79 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'}
-DOCUMENTATION = '''
+DOCUMENTATION = r'''
---
module: mongodb_parameter
-short_description: Change an administrative parameter on a MongoDB server.
+short_description: Change an administrative parameter on a MongoDB server
description:
- Change an administrative parameter on a MongoDB server.
version_added: "2.1"
options:
login_user:
description:
- - The username used to authenticate with
+ - The MongoDB username used to authenticate with.
+ type: str
login_password:
description:
- - The password used to authenticate with
+ - The login user's password used to authenticate with.
+ type: str
login_host:
description:
- - The host running the database
+ - The host running the database.
+ type: str
default: localhost
login_port:
description:
- - The port to connect to
+ - The MongoDB port to connect to.
default: 27017
+ type: int
login_database:
description:
- - The database where login credentials are stored
+ - The database where login credentials are stored.
+ type: str
replica_set:
description:
- - Replica set to connect to (automatically connects to primary for writes)
- database:
- description:
- - The name of the database to add/remove the user from
- required: true
+ - Replica set to connect to (automatically connects to primary for writes).
+ type: str
ssl:
description:
- - Whether to use an SSL connection when connecting to the database
+ - Whether to use an SSL connection when connecting to the database.
type: bool
- default: 'no'
+ default: no
param:
description:
- - MongoDB administrative parameter to modify
+ - MongoDB administrative parameter to modify.
+ type: str
required: true
value:
description:
- - MongoDB administrative parameter value to set
+ - MongoDB administrative parameter value to set.
+ type: str
required: true
param_type:
description:
- - Define the parameter value (str, int)
+ - Define the type of parameter value.
default: str
+ type: str
+ choices: [int, str]
notes:
- - Requires the pymongo Python package on the remote host, version 2.4.2+. This
- can be installed using pip or the OS package manager. @see http://api.mongodb.org/python/current/installation.html
+ - Requires the pymongo Python package on the remote host, version 2.4.2+.
+ - This can be installed using pip or the OS package manager.
+ - See also U(http://api.mongodb.org/python/current/installation.html)
requirements: [ "pymongo" ]
author: "Loic Blot (@nerzhul)"
'''
-EXAMPLES = '''
-# Set MongoDB syncdelay to 60 (this is an int)
-- mongodb_parameter:
+EXAMPLES = r'''
+- name: Set MongoDB syncdelay to 60 (this is an int)
+ mongodb_parameter:
param: syncdelay
value: 60
param_type: int
'''
-RETURN = '''
+RETURN = r'''
before:
description: value before modification
returned: success
@@ -148,8 +155,8 @@ def main():
login_port=dict(default=27017, type='int'),
login_database=dict(default=None),
replica_set=dict(default=None),
- param=dict(default=None, required=True),
- value=dict(default=None, required=True),
+ param=dict(required=True),
+ value=dict(required=True),
param_type=dict(default="str", choices=['str', 'int']),
ssl=dict(default=False, type='bool'),
)
diff --git a/lib/ansible/modules/database/mongodb/mongodb_replicaset.py b/lib/ansible/modules/database/mongodb/mongodb_replicaset.py
index eed707dfbc..090724dd88 100644
--- a/lib/ansible/modules/database/mongodb/mongodb_replicaset.py
+++ b/lib/ansible/modules/database/mongodb/mongodb_replicaset.py
@@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = r'''
---
module: mongodb_replicaset
-short_description: Initialises a MongoDB replicaset.
+short_description: Initialises a MongoDB replicaset
description:
- Initialises a MongoDB replicaset in a new deployment.
- Validates the replicaset name for existing deployments.
@@ -54,6 +54,7 @@ options:
- Supply as a simple csv string, i.e. mongodb1:27017,mongodb2:27017,mongodb3:27017.
- If a port number is not provided then 27017 is assumed.
type: list
+ elements: raw
validate:
description:
- Performs some basic validation on the provided replicaset config.
@@ -299,7 +300,7 @@ def main():
login_host=dict(type='str', default="localhost"),
login_port=dict(type='int', default=27017),
replica_set=dict(type='str', default="rs0"),
- members=dict(type='list'),
+ members=dict(type='list', elements='raw'),
arbiter_at_index=dict(type='int'),
validate=dict(type='bool', default=True),
ssl=dict(type='bool', default=False),