community.network.ce_facts 模块 – 获取华为CloudEngine交换机的facts。
注意
此模块是 community.network 集合 (版本 5.1.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.network
。
要在 playbook 中使用它,请指定: community.network.ce_facts
。
注意
community.network 集合已被弃用,并将从 Ansible 12 中移除。请参阅 讨论主题 获取更多信息。
已弃用
- 在以下版本中移除:
版本 6.0.0
- 原因:
此集合及其中的所有内容均未维护且已弃用。
- 替代方案:
未知。
摘要
从运行 CloudEngine 操作系统的 CloudEngine 设备收集 facts。Fact 收集通过 Cli 传输方式支持。此模块将所有基本网络 fact 键名前缀添加
ansible_net_<fact>
。facts 模块将始终从设备收集一组基本 facts,并且可以启用或禁用其他 facts 的收集。
别名:network.cloudengine.ce_facts
参数
参数 |
注释 |
---|---|
提供此参数时,它将收集的 facts 限制为给定的子集。此参数的可能值为 all、hardware、config 和 interfaces。可以指定一个值列表以包含更大的子集。值也可以与初始 默认值: |
备注
注意
推荐的连接是
network_cli
。此模块也适用于旧版 playbook 的
local
连接。
示例
# Note: examples below use the following provider dict to handle
# transport and authentication to the node.
- name: CloudEngine facts test
hosts: cloudengine
connection: local
gather_facts: false
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
tasks:
- name: "Gather_subset is all"
community.network.ce_facts:
gather_subset: all
provider: "{{ cli }}"
- name: "Collect only the config facts"
community.network.ce_facts:
gather_subset: config
provider: "{{ cli }}"
- name: "Do not collect hardware facts"
community.network.ce_facts:
gather_subset: "!hardware"
provider: "{{ cli }}"
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
设备上配置的所有 IPv4 地址 返回:当配置 interfaces 时 |
|
远程设备上运行的 BIOS 版本 返回:始终返回 |
|
远程设备的主板类型 返回:始终返回 |
|
设备上的当前系统配置 返回:当配置 config 时 |
|
远程设备上运行的 CPLD1 版本 返回:始终返回 |
|
远程设备上运行的 CPLD2 版本 返回:始终返回 |
|
设备上的风扇状态 返回:当配置 hardware 时 |
|
设备上的文件系统 返回:当配置 hardware 时 |
|
设备上的可用 flash 空间 返回:当配置 hardware 时 |
|
设备上的总 flash 空间 返回:当配置 hardware 时 |
|
从设备收集的 fact 子集列表 返回:始终返回 |
|
远程设备的主机名 返回:始终返回 |
|
系统上所有接口的哈希表 返回:当配置 interfaces 时 |
|
远程设备上运行的 MAB 版本 返回:始终返回 |
|
远程设备上的可用内存空间 返回:当配置 hardware 时 |
|
远程设备上的总内存空间 返回:当配置 hardware 时 |
|
远程设备的 LLDP 邻居列表 返回:当配置 interfaces 时 |
|
远程设备上运行的 PCB 版本 返回:始终返回 |
|
设备上的电源状态 返回:当配置 hardware 时 |
状态
此模块将在 6.0.0 版本中移除。[已弃用]
更多信息请参见 已弃用。