community.digitalocean.digital_ocean_database_info – Gather information about DigitalOcean databases

Note

This plugin is part of the community.digitalocean collection (version 1.9.0).

To install it use: ansible-galaxy collection install community.digitalocean.

To use it in a playbook, specify: community.digitalocean.digital_ocean_database_info.

New in version 1.3.0: of community.digitalocean

Synopsis

  • Gather information about DigitalOcean databases.

Parameters

Parameter Choices/Defaults Comments
id
integer
A unique ID that can be used to identify and reference a database cluster.

aliases: database_id
name
string
A unique, human-readable name for the database cluster.
oauth_token
string
DigitalOcean OAuth token.
There are several other environment variables which can be used to provide this value.
i.e., - 'DO_API_TOKEN', 'DO_API_KEY', 'DO_OAUTH_TOKEN' and 'OAUTH_TOKEN'

aliases: api_token
timeout
integer
Default:
30
The timeout in seconds used for polling DigitalOcean's API.
validate_certs
boolean
    Choices:
  • no
  • yes ←
If set to no, the SSL certificates will not be validated.
This should only set to no used on personally controlled sites using self-signed certificates.

Examples

- name: Gather all DigitalOcean databases
  community.digitalocean.digital_ocean_database_info:
    oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_KEY') }}"
  register: my_databases

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
data
list / elements=string
success
List of DigitalOcean databases

Sample:
[{'connection': {'database': '', 'host': 'testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com', 'password': 'REDACTED', 'port': 25061, 'protocol': 'rediss', 'ssl': True, 'uri': 'rediss://default:[email protected]:25061', 'user': 'default'}, 'created_at': '2021-04-21T15:41:14Z', 'db_names': None, 'engine': 'redis', 'id': '37de10e4-808b-4f4b-b25f-7b5b3fd194ac', 'maintenance_window': {'day': 'monday', 'hour': '11:33:47', 'pending': False}, 'name': 'testdatabase1', 'num_nodes': 1, 'private_connection': {'database': '', 'host': 'private-testdatabase1-do-user-3097135-0.b.db.ondigitalocean.com', 'password': 'REDACTED', 'port': 25061, 'protocol': 'rediss', 'ssl': True, 'uri': 'rediss://default:[email protected]cean.com:25061', 'user': 'default'}, 'private_network_uuid': '0db3519b-9efc-414a-8868-8f2e6934688c', 'region': 'nyc1', 'size': 'db-s-1vcpu-1gb', 'status': 'online', 'tags': None, 'users': None, 'version': '6'}, '...']


Authors

  • Mark Mercado (@mamercad)