mongodb_shard: fix doc formatting (#67750)
This commit is contained in:
parent
d5c17118ed
commit
10feb24870
2 changed files with 39 additions and 32 deletions
|
@ -13,43 +13,49 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: mongodb_shard
|
module: mongodb_shard
|
||||||
short_description: Add and remove shards from a MongoDB Cluster.
|
short_description: Add or remove shards from a MongoDB Cluster
|
||||||
description:
|
description:
|
||||||
- Add and remove shards from a MongoDB Cluster.
|
- Add or remove shards from a MongoDB Cluster.
|
||||||
author: Rhys Campbell (@rhysmeister)
|
author: Rhys Campbell (@rhysmeister)
|
||||||
version_added: "2.8"
|
version_added: "2.8"
|
||||||
options:
|
options:
|
||||||
login_user:
|
login_user:
|
||||||
description:
|
description:
|
||||||
- The user to login with.
|
- The MongoDB user to login with.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
login_password:
|
login_password:
|
||||||
description:
|
description:
|
||||||
- The password used to authenticate with.
|
- The login user's password used to authenticate with.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
login_database:
|
login_database:
|
||||||
description:
|
description:
|
||||||
- The database where login credentials are stored.
|
- The database where login credentials are stored.
|
||||||
required: false
|
required: false
|
||||||
default: "admin"
|
type: str
|
||||||
|
default: admin
|
||||||
login_host:
|
login_host:
|
||||||
description:
|
description:
|
||||||
- The host to login to.
|
- The host to login to.
|
||||||
- This must be a mongos.
|
- This must be a mongos.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
default: localhost
|
default: localhost
|
||||||
login_port:
|
login_port:
|
||||||
description:
|
description:
|
||||||
- The port to login to.
|
- The MongoDB port to login to.
|
||||||
required: false
|
required: false
|
||||||
|
type: int
|
||||||
default: 27017
|
default: 27017
|
||||||
shard:
|
shard:
|
||||||
description:
|
description:
|
||||||
- The shard connection string.
|
- The shard connection string.
|
||||||
- Should be supplied in the form <replicaset>/host:port as detailed in U(https://docs.mongodb.com/manual/tutorial/add-shards-to-shard-cluster/).
|
- Should be supplied in the form <replicaset>/host:port as detailed
|
||||||
|
in U(https://docs.mongodb.com/manual/tutorial/add-shards-to-shard-cluster/).
|
||||||
- For example rs0/example1.mongodb.com:27017.
|
- For example rs0/example1.mongodb.com:27017.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
type: str
|
||||||
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.
|
||||||
|
@ -57,40 +63,43 @@ options:
|
||||||
type: bool
|
type: bool
|
||||||
ssl_cert_reqs:
|
ssl_cert_reqs:
|
||||||
description:
|
description:
|
||||||
- Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided.
|
- Specifies whether a certificate is required from the other side of the connection,
|
||||||
|
and whether it will be validated if provided.
|
||||||
required: false
|
required: false
|
||||||
default: "CERT_REQUIRED"
|
type: str
|
||||||
choices: ["CERT_REQUIRED", "CERT_OPTIONAL", "CERT_NONE"]
|
default: CERT_REQUIRED
|
||||||
|
choices: [CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED]
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Whether the shard should be present or absent from the Cluster.
|
- Whether the shard should be present or absent from the Cluster.
|
||||||
required: false
|
required: false
|
||||||
|
type: str
|
||||||
default: present
|
default: present
|
||||||
choices: ["present", "absent"]
|
choices: [absent, present]
|
||||||
|
|
||||||
notes:
|
notes:
|
||||||
- Requires the pymongo Python package on the remote host, version 2.4.2+.
|
- 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 U(http://api.mongodb.org/python/current/installation.html).
|
|
||||||
requirements: [ "pymongo" ]
|
requirements: [ pymongo ]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# add a replicaset shard named rs1 with a member running on port 27018 on mongodb0.example.net
|
- name: Add a replicaset shard named rs1 with a member running on port 27018 on mongodb0.example.net
|
||||||
- mongodb_shard:
|
mongodb_shard:
|
||||||
login_user: admin
|
login_user: admin
|
||||||
login_password: admin
|
login_password: admin
|
||||||
shard: "rs1/mongodb0.example.net:27018"
|
shard: "rs1/mongodb0.example.net:27018"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# add a standalone mongod shard running on port 27018 of mongodb0.example.net
|
- name: Add a standalone mongod shard running on port 27018 of mongodb0.example.net
|
||||||
- mongodb_shard:
|
mongodb_shard:
|
||||||
login_user: admin
|
login_user: admin
|
||||||
login_password: admin
|
login_password: admin
|
||||||
shard: "mongodb0.example.net:27018"
|
shard: "mongodb0.example.net:27018"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# To remove a shard called 'rs1'
|
- name: To remove a shard called 'rs1'
|
||||||
- mongodb_shard:
|
mongodb_shard:
|
||||||
login_user: admin
|
login_user: admin
|
||||||
login_password: admin
|
login_password: admin
|
||||||
shard: rs1
|
shard: rs1
|
||||||
|
@ -231,15 +240,16 @@ def load_mongocnf():
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(argument_spec=dict(login_user=dict(default=None),
|
module = AnsibleModule(argument_spec=dict(login_user=dict(type='str', required=False),
|
||||||
login_password=dict(default=None, no_log=True),
|
login_password=dict(type='str', required=False, no_log=True),
|
||||||
login_database=dict(default="admin"),
|
login_database=dict(type='str', required=False, default='admin'),
|
||||||
login_host=dict(default="localhost", required=False),
|
login_host=dict(type='str', required=False, default='localhost'),
|
||||||
login_port=dict(default=27017, type='int', required=False),
|
login_port=dict(type='int', default=27017, required=False),
|
||||||
ssl=dict(default=False, type='bool'),
|
ssl=dict(type='bool', default=False, required=False),
|
||||||
ssl_cert_reqs=dict(default='CERT_REQUIRED', choices=['CERT_NONE', 'CERT_OPTIONAL', 'CERT_REQUIRED']),
|
ssl_cert_reqs=dict(type='str', required=False, default='CERT_REQUIRED',
|
||||||
shard=dict(default=None),
|
choices=['CERT_NONE', 'CERT_OPTIONAL', 'CERT_REQUIRED']),
|
||||||
state=dict(required=False, default="present", choices=["present", "absent"])),
|
shard=dict(type='str', required=True),
|
||||||
|
state=dict(type='str', required=False, default='present', choices=['absent', 'present'])),
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
if not pymongo_found:
|
if not pymongo_found:
|
||||||
|
|
|
@ -2822,9 +2822,6 @@ lib/ansible/modules/database/mongodb/mongodb_parameter.py validate-modules:param
|
||||||
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_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_shard.py validate-modules:doc-missing-type
|
|
||||||
lib/ansible/modules/database/mongodb/mongodb_shard.py validate-modules:doc-required-mismatch
|
|
||||||
lib/ansible/modules/database/mongodb/mongodb_shard.py validate-modules:parameter-type-not-in-doc
|
|
||||||
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
|
||||||
lib/ansible/modules/database/mongodb/mongodb_user.py validate-modules:parameter-list-no-elements
|
lib/ansible/modules/database/mongodb/mongodb_user.py validate-modules:parameter-list-no-elements
|
||||||
|
|
Loading…
Reference in a new issue