community.digitalocean.digital_ocean_project – Manage a DigitalOcean project
Note
This plugin is part of the community.digitalocean collection (version 1.11.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
.
New in version 1.6.0: of community.digitalocean
Synopsis
- Manage a project in DigitalOcean
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
description string | The description of the project. The maximum length is 255 characters. | |
environment string |
| The environment of the projects resources. |
id string | UUID of the project | |
is_default boolean |
| If true, all resources will be added to this project if no project is specified. |
name string | The human-readable name for the project. The maximum length is 175 characters and the name must be unique. | |
oauth_token string / required | DigitalOcean OAuth token. Can be specified in DO_API_KEY , DO_API_TOKEN , or DO_OAUTH_TOKEN environment variablesaliases: API_TOKEN | |
purpose string | The purpose of the project. The maximum length is 255 characters Required if state is present
If not one of DO provided purposes, will be prefixed with Other
DO provided purposes can be found below Just trying out DigitalOcean Class project/Educational Purposes Website or blog Web Application Service or API Mobile Application Machine Learning/AI/Data Processing IoT Operational/Developer tooling | |
state string |
| Indicate desired state of the target. present will create the projectabsent will delete the project, if it exists. |
Examples
# Creates a new project - community.digitalocean.digital_ocean_project: name: "TestProj" state: "present" description: "This is a test project" purpose: "IoT" environment: "Development" # Updates the existing project with the new environment - community.digitalocean.digital_ocean_project: name: "TestProj" state: "present" description: "This is a test project" purpose: "IoT" environment: "Production" # This renames an existing project by utilizing the id of the project - community.digitalocean.digital_ocean_project: name: "TestProj2" id: "12312312-abcd-efgh-ijkl-123123123123" state: "present" description: "This is a test project" purpose: "IoT" environment: "Development" # This creates a project that results with a purpose of "Other: My Prod App" - community.digitalocean.digital_ocean_project: name: "ProdProj" state: "present" description: "This is a prod app" purpose: "My Prod App" environment: "Production" # This removes a project - community.digitalocean.digital_ocean_project: name: "ProdProj" state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
data dictionary | changed | a DigitalOcean Project Sample: {'project': {'created_at': '2021-05-28T00:00:00Z', 'description': 'This is a test description', 'environment': 'Development', 'id': '12312312-abcd-efgh-1234-abcdefgh123', 'is_default': False, 'name': 'Test123', 'owner_id': 1234567, 'owner_uuid': '12312312-1234-5678-abcdefghijklm', 'purpose': 'IoT', 'updated_at': '2021-05-29T00:00:00Z'}} |
Authors
- Tyler Auerbeck (@tylerauerbeck)
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/digitalocean/digital_ocean_project_module.html