community.digitalocean.digital_ocean_project_resource_info 模块 – 收集 DigitalOcean 项目资源信息

注意

此模块是 community.digitalocean 集合 (版本 1.27.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.digitalocean

要在 playbook 中使用它,请指定: community.digitalocean.digital_ocean_project_resource_info

community.digitalocean 1.25.0 中的新增功能

概要

  • 此模块可用于收集项目资源信息。

参数

参数

注释

baseurl

字符串

DigitalOcean API 基本 URL。

默认值: "https://api.digitalocean.com/v2"

id

字符串

可用于标识和引用项目的项目 ID。

如果未指定 idname,则将使用默认项目。

name

字符串

可用于标识和引用项目的项目名称。

如果未指定 idname,则将使用默认项目。

oauth_token

别名:api_token

字符串

DigitalOcean OAuth 令牌。

可以使用其他几个环境变量来提供此值。

例如,- DO_API_TOKENDO_API_KEYDO_OAUTH_TOKENOAUTH_TOKEN

timeout

整数

用于轮询 DigitalOcean API 的超时时间(秒)。

默认值: 30

validate_certs

布尔值

如果设置为 no,则不会验证 SSL 证书。

此值应仅在使用自签名证书的个人控制站点上设置为 no

选项

  • false

  • true ← (默认值)

示例

- name: Get project resources by id
  community.digitalocean.digital_ocean_project_resource_info:
    id: cb1ef55e-3cd8-4c7c-aa5d-07c32bf41627

- name: Get project resources by name
  community.digitalocean.digital_ocean_project_resource_info:
    name: my-project-name

- name: Get default project resources
  community.digitalocean.digital_ocean_project_resource_info:

返回值

常见的返回值已在此处记录,以下是此模块特有的字段

描述

data

列表 / 元素=字典

DigitalOcean 项目资源信息

返回:成功

示例: [{"assigned_at": "2018-09-28T19:26:37Z", "links": {"self": "https://api.digitalocean.com/v2/droplets/13457723"}, "status": "ok", "urn": "do:droplet:13457723"}, {"assigned_at": "2019-03-31T16:24:14Z", "links": {"self": "https://api.digitalocean.com/v2/domains/example.com"}, "status": "ok", "urn": "do:domain:example.com"}]

作者

  • Raman Babich (@raman-babich)