Hi all, we would like to create a playbook to automate some tasks, like create projects, ApiKeys, roles etc using Ansible, by the moment i have not found specific info about how to connect an Atlas Org or project from ansible, is there a way to do it?, thansk for your help
Skip to main content
Hi Reply to myself, next workd fine,
- name: Create Project in Atlas
uri:
url: “https://cloud.mongodb.com/api/atlas/v1.0/groups?projectOwnerId={{ UAID.msg }}”
user: “{{ atlas_public_key }}”
password: “{{ atlas_private_key }}”
method: POST
body: ‘{ “name”: “{{name projeect}}”, “orgId”: “{{ atlas_OID }}” }’
force_basic_auth: no
status_code: [201, 409]
body_format: json
There are some modules for mongodb but nothing specific for Atlas. So yes, your using uri or writing your own module.
I don’t think there are endpoints for everything you’re wanting to do but there is quite a lot that is useful in the API.
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
WHAT IS THE HOST METRICS USED FOR REPLICATION LAG? | 0 | 296 | Apr 2024 |
Failed to connect to cluster using a env file | 3 | 1.1k | May 2024 |
Connecting MongoDB Atlas & GCP virtual machine through private endpoint fails. | 0 | 482 | Jun 2024 |
How to create Atlas App ID? | 0 | 172 | Oct 2024 |
Do Atlas Invoices provide a per cluster cost breakdown? | 1 | 38 | Dec 2024 |