community.mongodb.mongodb_atlas_whitelist module – Manage IP whitelists in Atlas

Note

This module is part of the community.mongodb collection (version 1.7.3).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.mongodb.

To use it in a playbook, specify: community.mongodb.mongodb_atlas_whitelist.

Synopsis

  • The mongodb_atlas_whitelist module manages a Atlas project’s IP whitelist.

  • API Documentation

Parameters

Parameter

Comments

api_password

aliases: apiPassword

string / required

The password for use in authentication with the Atlas API.

Can use API users and tokens (private key is password)

api_username

aliases: apiUsername

string / required

The username for use in authentication with the Atlas API.

Can use API users and tokens (public key is username)

cidr_block

aliases: cidrBlock

string / required

Whitelist entry in Classless Inter-Domain Routing (CIDR) notation.

comment

string

Optional Comment associated with the whitelist entry.

Default: "created by Ansible"

group_id

aliases: groupId

string / required

Unique identifier for the Atlas project.

state

string

State of the ressource.

Choices:

  • "present" ← (default)

  • "absent"

Examples

- name: test whitelist
  community.mongodb.mongodb_atlas_whitelist:
    api_username: "API_user"
    api_password: "API_passwort_or_token"
    group_id: "GROUP_ID"
    cidr_block: "192.168.0.0/24"
    comment: "test"

Authors

  • Martin Schurz (@schurzi)