community.digitalocean.digital_ocean_project_info module – Gather information about DigitalOcean Projects

Note

This module is part of the community.digitalocean collection (version 1.20.0).

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.digitalocean.

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

New in version 1.6.0: of community.digitalocean

Synopsis

  • This module can be used to gather information about Projects.

Parameters

Parameter

Comments

baseurl

string

DigitalOcean API base url.

Default: “https://api.digitalocean.com/v2”

id

string

Project ID that can be used to identify and reference a project.

name

string

Project name that can be used to identify and reference a project.

oauth_token

aliases: api_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’

timeout

integer

The timeout in seconds used for polling DigitalOcean’s API.

Default: 30

validate_certs

boolean

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.

Choices:

  • no

  • yes ← (default)

Examples

# Get specific project by id
- community.digitalocean.digital_ocean_project_info:
    id: cb1ef55e-3cd8-4c7c-aa5d-07c32bf41627

# Get specific project by name
- community.digitalocean.digital_ocean_project_info:
    name: my-project-name

# Get all projects
- community.digitalocean.digital_ocean_project_info:
  register: projects

Return Values

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

Key

Description

data

list / elements=dictionary

DigitalOcean project information

Returned: success

Sample: [{“created_at”: “2021-03-11T00:00:00Z”, “description”: “My project description”, “environment”: “Development”, “id”: “12345678-abcd-efgh-5678-10111213”, “is_default”: false, “name”: “my-test-project”, “owner_id”: 12345678, “owner_uuid”: “12345678-1234-4321-abcd-20212223”, “purpose”: “”, “updated_at”: “2021-03-11T00:00:00Z”}]

Authors

  • Tyler Auerbeck (@tylerauerbeck)