mongodb: Fix documentation (#67806)

* Added correct datatypes of parameter
* Fixed doc formatting

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2020-02-28 08:51:06 +05:30 committed by GitHub
parent 8e31a2fe40
commit 0cd22abe8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 33 deletions

View file

@ -16,72 +16,79 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: mongodb_parameter module: mongodb_parameter
short_description: Change an administrative parameter on a MongoDB server. short_description: Change an administrative parameter on a MongoDB server
description: description:
- Change an administrative parameter on a MongoDB server. - Change an administrative parameter on a MongoDB server.
version_added: "2.1" version_added: "2.1"
options: options:
login_user: login_user:
description: description:
- The username used to authenticate with - The MongoDB username used to authenticate with.
type: str
login_password: login_password:
description: description:
- The password used to authenticate with - The login user's password used to authenticate with.
type: str
login_host: login_host:
description: description:
- The host running the database - The host running the database.
type: str
default: localhost default: localhost
login_port: login_port:
description: description:
- The port to connect to - The MongoDB port to connect to.
default: 27017 default: 27017
type: int
login_database: login_database:
description: description:
- The database where login credentials are stored - The database where login credentials are stored.
type: str
replica_set: replica_set:
description: description:
- Replica set to connect to (automatically connects to primary for writes) - Replica set to connect to (automatically connects to primary for writes).
database: type: str
description:
- The name of the database to add/remove the user from
required: true
ssl: ssl:
description: 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 type: bool
default: 'no' default: no
param: param:
description: description:
- MongoDB administrative parameter to modify - MongoDB administrative parameter to modify.
type: str
required: true required: true
value: value:
description: description:
- MongoDB administrative parameter value to set - MongoDB administrative parameter value to set.
type: str
required: true required: true
param_type: param_type:
description: description:
- Define the parameter value (str, int) - Define the type of parameter value.
default: str default: str
type: str
choices: [int, str]
notes: notes:
- Requires the pymongo Python package on the remote host, version 2.4.2+. This - Requires the pymongo Python package on the remote host, version 2.4.2+.
can be installed using pip or the OS package manager. @see http://api.mongodb.org/python/current/installation.html - This can be installed using pip or the OS package manager.
- See also U(http://api.mongodb.org/python/current/installation.html)
requirements: [ "pymongo" ] requirements: [ "pymongo" ]
author: "Loic Blot (@nerzhul)" author: "Loic Blot (@nerzhul)"
''' '''
EXAMPLES = ''' EXAMPLES = r'''
# Set MongoDB syncdelay to 60 (this is an int) - name: Set MongoDB syncdelay to 60 (this is an int)
- mongodb_parameter: mongodb_parameter:
param: syncdelay param: syncdelay
value: 60 value: 60
param_type: int param_type: int
''' '''
RETURN = ''' RETURN = r'''
before: before:
description: value before modification description: value before modification
returned: success returned: success
@ -148,8 +155,8 @@ def main():
login_port=dict(default=27017, type='int'), login_port=dict(default=27017, type='int'),
login_database=dict(default=None), login_database=dict(default=None),
replica_set=dict(default=None), replica_set=dict(default=None),
param=dict(default=None, required=True), param=dict(required=True),
value=dict(default=None, required=True), value=dict(required=True),
param_type=dict(default="str", choices=['str', 'int']), param_type=dict(default="str", choices=['str', 'int']),
ssl=dict(default=False, type='bool'), ssl=dict(default=False, type='bool'),
) )

View file

@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = r''' DOCUMENTATION = r'''
--- ---
module: mongodb_replicaset module: mongodb_replicaset
short_description: Initialises a MongoDB replicaset. short_description: Initialises a MongoDB replicaset
description: description:
- Initialises a MongoDB replicaset in a new deployment. - Initialises a MongoDB replicaset in a new deployment.
- Validates the replicaset name for existing deployments. - 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. - 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. - If a port number is not provided then 27017 is assumed.
type: list type: list
elements: raw
validate: validate:
description: description:
- Performs some basic validation on the provided replicaset config. - Performs some basic validation on the provided replicaset config.
@ -299,7 +300,7 @@ def main():
login_host=dict(type='str', default="localhost"), login_host=dict(type='str', default="localhost"),
login_port=dict(type='int', default=27017), login_port=dict(type='int', default=27017),
replica_set=dict(type='str', default="rs0"), replica_set=dict(type='str', default="rs0"),
members=dict(type='list'), members=dict(type='list', elements='raw'),
arbiter_at_index=dict(type='int'), arbiter_at_index=dict(type='int'),
validate=dict(type='bool', default=True), validate=dict(type='bool', default=True),
ssl=dict(type='bool', default=False), ssl=dict(type='bool', default=False),

View file

@ -2801,13 +2801,7 @@ lib/ansible/modules/database/misc/riak.py validate-modules:doc-default-does-not-
lib/ansible/modules/database/misc/riak.py validate-modules:doc-missing-type lib/ansible/modules/database/misc/riak.py validate-modules:doc-missing-type
lib/ansible/modules/database/misc/riak.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/database/misc/riak.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/mongodb/mongodb_parameter.py use-argspec-type-path lib/ansible/modules/database/mongodb/mongodb_parameter.py use-argspec-type-path
lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:doc-choices-do-not-match-spec
lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:doc-missing-type
lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:no-default-for-required-parameter
lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:nonexistent-parameter-documented
lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/mongodb/mongodb_replicaset.py use-argspec-type-path lib/ansible/modules/database/mongodb/mongodb_replicaset.py use-argspec-type-path
lib/ansible/modules/database/mongodb/mongodb_replicaset.py validate-modules:parameter-list-no-elements
lib/ansible/modules/database/mongodb/mongodb_shard.py use-argspec-type-path lib/ansible/modules/database/mongodb/mongodb_shard.py use-argspec-type-path
lib/ansible/modules/database/mongodb/mongodb_user.py use-argspec-type-path lib/ansible/modules/database/mongodb/mongodb_user.py use-argspec-type-path
lib/ansible/modules/database/mongodb/mongodb_user.py validate-modules:doc-missing-type lib/ansible/modules/database/mongodb/mongodb_user.py validate-modules:doc-missing-type