ansible.builtin.mongodb_parameter (v2.9.27) — module

Change an administrative parameter on a MongoDB server.

| "added in version" 2.1 of ansible.builtin"

Authors: Loic Blot (@nerzhul)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Change an administrative parameter on a MongoDB server.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Set MongoDB syncdelay to 60 (this is an int)
- mongodb_parameter:
    param: syncdelay
    value: 60
    param_type: int

Inputs

    
ssl:
    default: 'no'
    description:
    - Whether to use an SSL connection when connecting to the database
    type: bool

param:
    description:
    - MongoDB administrative parameter to modify
    required: true

value:
    description:
    - MongoDB administrative parameter value to set
    required: true

database:
    description:
    - The name of the database to add/remove the user from
    required: true

login_host:
    default: localhost
    description:
    - The host running the database

login_port:
    default: 27017
    description:
    - The port to connect to

login_user:
    description:
    - The username used to authenticate with

param_type:
    default: str
    description:
    - Define the parameter value (str, int)

replica_set:
    description:
    - Replica set to connect to (automatically connects to primary for writes)

login_database:
    description:
    - The database where login credentials are stored

login_password:
    description:
    - The password used to authenticate with

Outputs

after:
  description: value after modification
  returned: success
  type: str
before:
  description: value before modification
  returned: success
  type: str