community.general.ovh_monthly_billing 模块 – 管理 OVH 月度账单

注意

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

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

要安装它,请使用:ansible-galaxy collection install community.general。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。

要在剧本中使用它,请指定:community.general.ovh_monthly_billing

community.general 0.2.0 中的新增功能

概要

  • 启用 OVH 云实例上的月度账单(请注意,OVH 不允许禁用它)。

要求

执行此模块的主机需要以下要求。

  • ovh

参数

参数

注释

application_key

字符串

要使用的 applicationKey

application_secret

字符串

要使用的应用程序密钥

consumer_key

字符串

要使用的消费者密钥

endpoint

字符串

要使用的端点(例如 ovh-eu)

instance_id

字符串 / 必需

project_id

字符串 / 必需

属性

属性

支持

描述

check_mode

支持:完全支持

可以在 check_mode 下运行,并在不修改目标的情况下返回更改状态预测。

diff_mode

支持:不支持

在差异模式下,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

示例

- name: Basic usage, using auth from /etc/ovh.conf
  community.general.ovh_monthly_billing:
    project_id: 0c727a20aa144485b70c44dee9123b46
    instance_id: 8fa89ad2-8f08-4220-9fa4-9695ea23e948

# Get openstack cloud ID and instance ID, OVH use them in its API
- name: Get openstack cloud ID and instance ID
  os_server_info:
    cloud: myProjectName
    region_name: myRegionName
    server: myServerName
  register: openstack_servers

- name: Use IDs
  community.general.ovh_monthly_billing:
    project_id: "{{ openstack_servers.0.tenant_id }}"
    instance_id: "{{ openstack_servers.0.id }}"
    application_key: yourkey
    application_secret: yoursecret
    consumer_key: yourconsumerkey

作者

  • Francois Lallart (@fraff)