community.general.online_server_info 模块 – 收集关于 Online 服务器的信息

注意

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

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

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

要在 Playbook 中使用它,请指定:community.general.online_server_info

概要

参数

参数

注释

api_timeout

别名:timeout

整数

连接 Online API 的 HTTP 超时时间(以秒为单位)。

默认值: 30

api_token

别名:oauth_token

字符串 / 必需

Online OAuth 令牌。

api_url

别名:base_url

字符串

Online API URL。

默认值: "https://api.online.net"

validate_certs

布尔值

验证 Online API 的 SSL 证书。

选项

  • false

  • true ←(默认)

属性

属性

支持

描述

check_mode

支持:完全

此操作不会修改状态。

可以在 check_mode 中运行,并返回更改的状态预测,而无需修改目标。

diff_mode

支持: 不适用

此操作不会修改状态。

在 diff 模式下运行时,将返回已更改(或可能需要在 check_mode 中更改)的详细信息。

注释

注意

示例

- name: Gather Online server information
  community.general.online_server_info:
    api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
  register: result

- ansible.builtin.debug:
    msg: "{{ result.online_server_info }}"

返回值

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

描述

online_server_info

列表 / 元素=字典

来自 Online API 的响应。

有关更多详细信息,请参阅:https://console.online.net/en/api/

已返回:成功

示例: {"online_server_info": [{"abuse": "[email protected]", "anti_ddos": false, "bmc": {"session_key": null}, "boot_mode": "normal", "contacts": {"owner": "foobar", "tech": "foobar"}, "disks": [{"$ref": "/api/v1/server/hardware/disk/68452"}, {"$ref": "/api/v1/server/hardware/disk/68453"}], "drive_arrays": [{"disks": [{"$ref": "/api/v1/server/hardware/disk/68452"}, {"$ref": "/api/v1/server/hardware/disk/68453"}], "raid_controller": {"$ref": "/api/v1/server/hardware/raidController/9910"}, "raid_level": "RAID1"}], "hardware_watch": true, "hostname": "sd-42", "id": 42, "ip": [{"address": "195.154.172.149", "mac": "28:92:4a:33:5e:c6", "reverse": "195-154-172-149.rev.poneytelecom.eu.", "switch_port_state": "up", "type": "public"}, {"address": "10.90.53.212", "mac": "28:92:4a:33:5e:c7", "reverse": null, "switch_port_state": "up", "type": "private"}], "last_reboot": "2018-08-23T08:32:03.000Z", "location": {"block": "A", "datacenter": "DC3", "position": 19, "rack": "A23", "room": "4 4-4"}, "network": {"ip": ["195.154.172.149"], "ipfo": [], "private": ["10.90.53.212"]}, "offer": "Pro-1-S-SATA", "os": {"name": "FreeBSD", "version": "11.1-RELEASE"}, "power": "ON", "proactive_monitoring": false, "raid_controllers": [{"$ref": "/api/v1/server/hardware/raidController/9910"}], "support": "Basic service level"}]}

作者

  • Remy Leone (@remyleone)