community.network.nos_facts 模块 – 从运行 Extreme NOS 的设备收集信息

注意

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

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

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

要在剧本中使用它,请指定: community.network.nos_facts

注意

community.network 集合已被弃用,并将从 Ansible 12 中删除。有关详细信息,请参阅讨论主题

已弃用

:中删除

版本 6.0.0

原因:

此集合及其中的所有内容均未维护且已弃用。

替代方案:

未知。

概要

  • 从运行 NOS 的远程设备收集基本设备信息集。此模块将所有基本网络信息键添加前缀 ansible_net_<fact>。信息模块将始终从设备收集基本信息集,并且可以启用或禁用其他信息的收集。

别名:network.nos.nos_facts

参数

参数

注释

gather_subset

字符串

当提供此参数时,它会将收集的信息限制为给定的子集。此参数的可能值包括 all、hardware、config 和 interfaces。可以指定一个值列表以包含更大的子集。值也可以与初始 ! 一起使用,以指定不应收集特定的子集。

默认值: "!config"

说明

注意

  • 已针对 NOS 7.2.0 进行测试

示例

# Collect all facts from the device
- community.network.nos_facts:
    gather_subset: all

# Collect only the config and default facts
- community.network.nos_facts:
    gather_subset:
      - config

# Do not collect hardware facts
- community.network.nos_facts:
    gather_subset:
      - "!hardware"

返回值

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

描述

ansible_net_all_ipv4_addresses

列表 / 元素=字符串

设备上配置的所有 IPv4 地址

返回值: 当配置 interfaces 时

ansible_net_all_ipv6_addresses

列表 / 元素=字符串

设备上配置的所有主 IPv6 地址

返回值: 当配置 interfaces 时

ansible_net_config

字符串

来自设备的当前活动配置

返回值: 当配置 config 时

ansible_net_gather_subset

列表 / 元素=字符串

从设备收集的信息子集列表

返回值: 始终

ansible_net_hostname

字符串

设备的配置主机名

返回值: 始终

ansible_net_interfaces

字典

系统上运行的所有接口的哈希值

返回值: 当配置 interfaces 时

ansible_net_memfree_mb

整数

远程设备上以 Mb 为单位的可用空闲内存

返回值: 当配置 hardware 时

ansible_net_memtotal_mb

整数

远程设备上以 Mb 为单位的总内存

返回值: 当配置 hardware 时

ansible_net_model

字符串

从设备返回的型号名称

返回值: 始终

ansible_net_neighbors

字典

来自远程设备的 LLDP 邻居列表

返回值: 当配置 interfaces 时

ansible_net_serialnum

字符串

远程设备的序列号

返回值: 始终

ansible_net_version

字符串

远程设备上运行的操作系统版本

返回值: 始终

状态

  • 此模块将在 6.0.0 版本中删除。[已弃用]

  • 有关详细信息,请参阅已弃用

作者

  • Lindsay Hill (@LindsayHill)