community.general.ovh_monthly_billing 模块 – 管理 OVH 月度账单
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:community.general.ovh_monthly_billing。
community.general 0.2.0 中的新增功能
概要
- 在 OVH 云实例上启用月度账单(请注意,OVH 不允许禁用它)。 
要求
执行此模块的主机需要以下要求。
- ovh 
参数
| 参数 | 注释 | 
|---|---|
| 要使用的 applicationKey | |
| 要使用的应用程序密钥 | |
| 要使用的消费者密钥 | |
| 要使用的端点(例如 ovh-eu) | |
| 项目 ID,使用 https://api.ovh.com/console/#/cloud/project#GET 获取 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全 | 可以在  | |
| 支持:无 | 当处于差异模式时,将返回有关已更改(或可能需要在  | 
示例
- 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
